Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Travel time...over time

Avatar for Robin Wilson Robin Wilson
April 19, 2026
11

Travel time...over time

Avatar for Robin Wilson

Robin Wilson

April 19, 2026

More Decks by Robin Wilson

Transcript

  1. def get_travel_time(from_loc, to_loc): now = datetime.now() directions_result = gmaps.directions(from_loc, to_loc,

    mode="driving", departure_time=now) return directions_result[0]['legs'][0]['duration_in_traffic']['value'] Run in cron every 15 mins…