googlemaps 1.0.2
Easy geocoding, reverse geocoding, driving directions, and local search in Python via Google.
An easy-to-use Python wrapper for the Google Maps and Local Search APIs.
Geocoding: convert a postal address to latitude and longitude
>>> from googlemaps import GoogleMaps >>> gmaps = GoogleMaps(api_key) >>> address = 'Constitution Ave NW & 10th St NW, Washington, DC' >>> lat, lng = gmaps.address_to_latlng(address) >>> print lat, lng 38.8921021 -77.0260358
Reverse Geocoding: find the nearest address to (lat, lng)
>>> destination = gmaps.latlng_to_address(38.887563, -77.019929) >>> print destination Independence and 6th SW, Washington, DC 20024, USA
Local Search: find places matching a query near a given location
>>> local = gmaps.local_search('cafe near ' + destination)
>>> print local['responseData']['results'][0]['titleNoFormatting']
Vie De France Bakery & Cafe
Directions: turn-by-turn directions, distance, time, etc. from point A to point B
>>> directions = gmaps.directions(address, destination) >>> print directions['Directions']['Distance']['meters'] 1029 >>> print directions['Directions']['Duration']['seconds'] 106 >>> for step in directions['Directions']['Routes'][0]['Steps']: ... print step['descriptionHtml'] Head <b>east</b> on <b>Constitution Ave NW</b> toward <b>9th St NW</b> Take the 2nd <b>right</b> onto <b>7th St NW</b> Turn <b>left</b> at <b>Independence Ave SW</b>
This software is in no way associated with or endorsed by Google Inc. Use of the Google Maps API is governed by its Terms of Service: http://code.google.com/apis/maps/terms.html. Note in particular that you will need your own Google Maps API key to use this service, and that there are rate limits to the number of requests you can make.
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| googlemaps-1.0.2.tar.gz (md5) | Source | 2009-10-18 03:51:45.776109 | 59KB | 418 | |
| googlemaps-1.0.2.win32.exe (md5) | MS Windows installer | any | 2009-10-18 03:52:12.574506 | 69KB | 116 |
- Author: John Kleint <py-googlemaps-general at lists sourceforge net>
- Home Page: http://sourceforge.net/projects/py-googlemaps/
- Download URL: https://sourceforge.net/projects/py-googlemaps/files/
- Keywords: google maps local search ajax api geocode geocoding directions navigation json
- License: Lesser Affero General Public License v3
- Requires simplejson
- Provides googlemaps
-
Categories
- Development Status :: 5 - Production/Stable
- Intended Audience :: Developers
- License :: OSI Approved :: GNU Affero General Public License v3
- License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
- Natural Language :: English
- Operating System :: OS Independent
- Programming Language :: Python :: 2
- Topic :: Internet
- Topic :: Internet :: WWW/HTTP
- Topic :: Scientific/Engineering :: GIS
- Package Index Owner: jkleint
- DOAP record: googlemaps-1.0.2.xml
Log in to rate this package.
- 4 points: 1 vote
Ratings range from 0 to 5 (best).
