Skip to main content

A python api to google directions

Project description

Introduction

This lib allows you to query the google direction api from your python code, i.e. without a browser. The parser will give you a dict of anything that google knows about the direction: Distance, waypoints, corrected addresses and much more.

Although you have direct access to the parser output, you may also use the convenient api as seen in the Usage part below.

Usage

>>> from google.directions import GoogleDirections
>>> gd = GoogleDirections('your-google-directions-key')
>>> res = gd.query('berlin','paris')
>>> res.distance
1055351

You also have access to the raw parser data:

>>> res.result["Directions"]["Duration"]
{u'seconds': 34329, u'html': u'9 hours 32 mins'}

Have fun!

Contribution

If you extend the gdapi, I’d love to get your extensions. Just mail me the code and I’ll make a release. See below for the mail address.

Changelog

0.1 - Unreleased

0.2* - JS Parsers, DOM Parser fully working, Google API is working, but minimal.

0.2.1 - Fixed bad description and README.

0.2.2 - Fixed missing README.txt

0.2.3 - Allowed tab as space too

0.3 - splitted of the json parser as d9t.json. Now with tests and a better understanding of json.


  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google.directions-0.3.tar.gz (17.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page