In [ ]:
import pyofo
import json

In [ ]:
log_in = pyofo.LoginHandler(tel='remove', ccc='1', lat='36.0', lng='-78.9' )
r = log_in.request_sms_code()
r.text

In [ ]:
r = log_in.login_with_code(otp_code='remove')
r.text

In [ ]:
pyofo.set_token('deleted')
ofo = pyofo.Ofo()
r = ofo.nearby_ofo_car(lat='36.0', lng='-78.9')

In [ ]:
import gmaps as jupmap
f = open('private.key', 'r')
for line in f: 
    temp = line.rstrip('').replace(',','').replace('\n','').split(" ")
    exec(temp[0])
jupmap.configure(api_key=jupmap_key)
m = jupmap.Map()
home = (36.0160282, -78.9321707)
foodLion = (36.0193147,-78.9603636)
church = (35.9969749, -78.9091543)
dl = jupmap.directions_layer(church, home)
#googlemaps has an optimize_waypoints=True but I can't find it in jupyter gmaps 
m.add_layer(dl)
m

In [ ]:
r.json()['values']['cars']
for key, value in enumerate(r.json()['values']['cars']):
    print(value)

In [ ]:
marker_loc = [ (-78.900015547246, 36.000268625861), (-78.899991505183, 36.000308659339), ( -78.900002524102, 36.000595643858)]
fig = jupmap.figure()
markers = jupmap.marker_layer(marker_loc)
fig.add_layer(markers)                                                                                          
fig

In [ ]:
jupmap.plot(marker_loc)

In [ ]: