A Python package that calls Google Maps Platform web services from application code. It targets geocoding, directions, and related location APIs with an API key.
Overview
Google Maps Services Python is a client library that exposes Google Maps Platform web services to Python programs. It is meant for tasks such as geocoding addresses, fetching directions, and working with other location-related HTTP APIs from server-side or application code.
The client covers current services including elevation, geocoding, geolocation, time zone, roads, static maps, and address validation. It also still supports several legacy web service endpoints; the source notes that newer Places and Routes APIs are handled by separate official Python client libraries and will not be added here.
Each request needs an API key generated in Google Cloud, which the source says should be kept secret on the server. The library can automatically retry when the API returns certain intermittent server errors. Install it with pip; it depends on Python 3.5 or later and the requests HTTP library.
Use of Google Maps Platform through the library is subject to Google’s platform terms. The library itself is offered under an open source license and is not treated as a core platform service for support or SLA purposes.
Key features
- Geocoding API support
- Directions and distance APIs
- Elevation and roads APIs
- Geolocation and timezone APIs
- Static maps and address validation
- Automatic retry on retriable errors
Use cases
- Geocode addresses in Python apps
- Fetch directions between locations
- Call maps web services with an API key