Skip to content

A simple python script which pulls data from Google Maps API and displays them.

License

Notifications You must be signed in to change notification settings

debasishbai/Google-Distance-Matrix--python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google-Distance-Matrix--python

This is a simple python script which makes request to Google Maps API, pulls data from it and displays them.

User has to provide origins and destinations in a comma separated format.
Please Note: All the origins and destinations should belong to the same country.

Example:

Enter origins: mumbai,delhi
Enter destinations: bangalore, kolkata

The output displays the total distance (in km), average duration, live traffic (real time).
Have a look at the sample screenshot.

To make a request you need to have an API Key which you can get from https://developers.google.com/maps/documentation/distance-matrix/

If you want to get more details about how this API works then please refer the documentation https://developers.google.com/maps/documentation/distance-matrix/start

Limitations

  • As per Google's Terms and Conditions you can make 2500 free requests per day.
  • Maximum of 25 origins or 25 destinations per request.

For more details about usage limits please refer : https://developers.google.com/maps/documentation/distance-matrix/usage-limits

In the script:

  • Travelling mode is set to Driving
  • Departure time is set to Current Time
  • Traffic model is set to API default i.e, best_guess.

However you can make changes to the above parameters and accordingly change the display part.

To stop the script press Ctrl + Z or Ctrl + C.

Python version : 3.4
HTTP Client : requests ( pip install requests )
Refer the documentation : http://docs.python-requests.org/en/master/

Improvements are always welcome.

About

A simple python script which pulls data from Google Maps API and displays them.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages