Skip to content

Instantly share code, notes, and snippets.

@avivl
Created September 8, 2018 12:25
Show Gist options
  • Save avivl/f5a156eaf87d6a1c68b7b7a908777bdb to your computer and use it in GitHub Desktop.
Save avivl/f5a156eaf87d6a1c68b7b7a908777bdb to your computer and use it in GitHub Desktop.
gmaps = googlemaps.Client(key=key)
reverse_geocode_result = gmaps.reverse_geocode(
(location['latitude'], location['longitude']))
now = datetime.datetime.now()
directions_result = gmaps.directions(
reverse_geocode_result[0]['formatted_address'],
home[0]['address'],
mode="driving",
departure_time=now)
fulfillment_text = Name + " will be home in %s" % \
directions_result[0]['legs'][0]['duration_in_traffic'][
'text']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment