I need to get driving time between two sets of coordinates using Python. The only wrappers for the Google Maps API I have been able to find either use Google Maps API V2 (deprec
import googlemaps
from datetime import datetime
gmaps = googlemaps.Client(key='YOUR KEY')
now = datetime.now()
directions_result = gmaps.directions("18.997739, 72.841280",
"18.880253, 72.945137",
mode="driving",
avoid="ferries",
departure_time=now
)
print(directions_result[0]['legs'][0]['distance']['text'])
print(directions_result[0]['legs'][0]['duration']['text'])
This is been taken from here And alternatively you can change the parameters accordingly.