google.directions 0.3
A python api to google directions
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.
Copyright / License
GPLv3
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
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
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| google.directions-0.3.tar.gz (md5) | Source | 2009-03-30 21:28:02.584856 | 16KB | 209 | |
- Author: D9T GmbH, Daniel Kraft <dk at d9t de>
- Home Page: http://d9t.de/os
- Keywords: google directions d9t
- License: GPLv3
- Categories
- Package Index Owner: d9t
- DOAP record: google.directions-0.3.xml
Log in to rate this package.
- 3 points: 1 vote
Ratings range from 0 to 5 (best).
- I dont install the package in my Debian Lenny, I try with de setup.py install and easy_install google.directions but nothing, the instalation begin but then the system reponse Numerical Result out of range (romisol, 2009-10-23,
points) - Sorry, I don't understand your problem and even can't find any:
(test)dk@prag:~/tmp/test$ easy_install google.directions
Searching for google.directions
Reading http://pypi.python.org/simple/google.directions/
Reading http://d9t.de/os
Best match: google.directions 0.3
Downloading http://pypi.python.org/packages/source/g/google.directions/google.directions-0.3.tar.gz#md5=9ef59b0fa9cc3d145bbb9ba934db22c2
Processing google.directions-0.3.tar.gz
Running google.directions-0.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Gsopu0/google.directions-0.3/egg-dist-tmp-FlTVi7
Adding google.directions 0.3 to easy-install.pth file
Installed /home/dk/tmp/test/lib/python2.6/site-packages/google.directions-0.3-py2.6.egg
Processing dependencies for google.directions
Searching for d9t.json
Reading http://pypi.python.org/simple/d9t.json/
Best match: d9t.json 0.4
Downloading http://pypi.python.org/packages/source/d/d9t.json/d9t.json-0.4.tar.gz#md5=847c6c8abb58847288999d9aa622194f
Processing d9t.json-0.4.tar.gz
Running d9t.json-0.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-6Ofa1U/d9t.json-0.4/egg-dist-tmp-LH4Gel
Adding d9t.json 0.4 to easy-install.pth file
Installed /home/dk/tmp/test/lib/python2.6/site-packages/d9t.json-0.4-py2.6.egg
Finished processing dependencies for google.directions (d9t, 2009-10-24)
- Sorry, I don't understand your problem and even can't find any:
