Created
September 8, 2018 12:25
-
-
Save avivl/f5a156eaf87d6a1c68b7b7a908777bdb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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