geopy
Python Geocoding Toolbox
What it is and what it does
geopy is a mature geocoding and distance-calculation library that abstracts away the complexity of calling multiple web-based geocoding services. It lets you convert an address string into latitude/longitude coordinates, reverse that process to find an address from coordinates, and compute distances between geographic points using geodesic or great-circle methods. The library wraps services like OpenStreetMap Nominatim and Google Geocoding API, so you can switch providers without rewriting your code.
The package is designed for developers who need to work with geographic data in Python—whether building location-aware applications, analyzing spatial datasets, or integrating map-based features. It handles the HTTP calls, response parsing, and coordinate math internally, leaving you to focus on your application logic. The single runtime dependency (geographiclib) keeps the install footprint small.
Use it for:
- Convert user-entered addresses into map coordinates for location-based search or mapping applications.
- Reverse-geocode GPS coordinates to display human-readable addresses in mobile or field-service apps.
- Calculate driving or straight-line distances between two locations for routing, delivery, or proximity analysis.
- Batch geocode a list of addresses to prepare geographic datasets for analysis or visualization.
- Switch between multiple geocoding providers (Nominatim, Google, etc.) without changing application code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
geopy is a Python client for geocoding and distance calculation that converts addresses to coordinates and vice versa using multiple web-based geocoding services, and computes geodesic and great-circle distances between geographic points.
Yes. geopy is a stable, actively maintained library with no known vulnerabilities, low install friction, and permissive licensing. It solves a common problem (address-to-coordinate conversion and distance calculation) with a clean API and support for multiple providers. Install it if you need geocoding or distance calculations in your application.
Install
geopy on PyPI
pip
pip install geopyuv
uv add geopypoetry
poetry add geopyInstalling geopy
Before you install
Low install friction with a single runtime dependency (geographiclib). The package is actively maintained with a recent release, has been in production use since 2006, and supports current Python versions (3.8 to 3.15).
License in practice
MIT license is permissive and places no restrictions on commercial or private use, modification, or distribution—only requires preservation of copyright and license notices.
Quickstart
pip install geopy
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="my_app")
location = geolocator.geocode("175 5th Avenue NYC")
print(location.latitude, location.longitude)
Requires a user_agent parameter for Nominatim; third-party geocoding services may have rate limits or require API keys.
Verify before relying
- Whether all supported geocoding services are documented with their individual rate limits and authentication requirements.
- Whether geographiclib is bundled or must be installed separately for distance calculations to work.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — geographiclib |
| Maintenance | actively maintained — 33 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 19,001,861/month — #1,075 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: geopy-2.5.0-py3-none-any.whl
Keywords: geocode, geocoding, gis, geographical, maps, earth, distance
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
geocoderGeocoder provides a unified Python interface to…
permissive · top 5,000 on PyPI
haversineCalculates great-circle distances between…
permissive · top 5,000 on PyPI
censusgeocodeWraps the US Census Geocoder API to convert…
copyleft · top 15,000 on PyPI
reverse-geocodeReverse Geocode converts latitude/longitude…
copyleft · top 15,000 on PyPI
googlemapsPython client library that wraps Google Maps…
permissive · top 5,000 on PyPI
opencageA Python wrapper for the OpenCage Geocoding API…
permissive · top 15,000 on PyPI
reverse_geocoderReverse Geocoder converts latitude/longitude…
copyleft · top 15,000 on PyPI
smartystreets-python-sdkA client library for accessing SmartyStreets…
permissive · top 15,000 on PyPI
azure-maps-searchProvides a Python client for Azure Maps Search…
permissive · top 15,000 on PyPI
searouteComputes the shortest sea route between two…
permissive · top 15,000 on PyPI