reverse-geocode
Reverse geocode the given latitude / longitude
What it is and what it does
Reverse Geocode is a Python library that maps latitude/longitude coordinates to their nearest known geographic location (country, state, city) using offline lookup rather than a web API. It structures geonames data into a k-d tree for efficient nearest-neighbor searches, making it practical for bulk geocoding tasks where calling an external service would be impractical or undesirable.
The package depends on numpy and scipy for its spatial indexing and numerical operations. Results are returned as dictionaries containing country code, country name, state, city, population, and exact coordinates of the matched location. You can filter results by minimum population to prefer larger cities over nearby smaller ones, though the package notes that point-based lookup gives only a rough approximation compared to polygon-based geographic systems.
Use it for:
- Batch reverse geocoding thousands of GPS coordinates from a dataset without hitting rate limits or API costs
- Finding the nearest city to a set of sensor readings or IoT device locations in an offline or air-gapped environment
- Filtering location results by population threshold to prioritize major cities over small towns in proximity searches
- Building location-aware analytics on historical coordinate data where real-time API access is not available
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reverse Geocode converts latitude/longitude coordinates to the nearest known country, state, and city using a k-d tree lookup against geonames data, without requiring a web API.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a specific problem (offline bulk reverse geocoding) that web APIs handle poorly. The LGPL license is permissive for non-modifying use. Install it if you need to map coordinates to cities at scale without external dependencies.
Install
reverse-geocode on PyPI
pip
pip install reverse-geocodeuv
uv add reverse-geocodepoetry
poetry add reverse-geocodeInstalling reverse-geocode
Before you install
Low friction install with only numpy and scipy as runtime dependencies. The package is actively maintained with a recent commit on 2026-08-01 and has been stable since its first release in 2015.
License in practice
Licensed under LGPL (copyleft), which requires that derivative works and modifications remain under the same license; using this package in proprietary software is permissible if you do not modify it, but modifications must be shared under LGPL terms.
Quickstart
pip install reverse-geocode
import reverse_geocode
melbourne_coord = -37.81, 144.96
result = reverse_geocode.get(melbourne_coord)
print(result)
Verify before relying
- Whether the package supports batch processing of very large coordinate sets efficiently
- How frequently the underlying geonames data is updated in the package
- Accuracy limitations beyond the note that it is point-based rather than polygon-based
Package facts
| License | lgpl (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, scipy |
| Maintenance | actively maintained — 456 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 366,666/month — #7,203 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: reverse_geocode-1.6.6-py3-none-any.whl
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
pgeocodepgeocode queries postal codes to retrieve GPS…
permissive · top 5,000 on PyPI
reverse_geocoderReverse Geocoder converts latitude/longitude…
copyleft · top 15,000 on PyPI
azure-maps-searchProvides a Python client for Azure Maps Search…
permissive · top 15,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
geotextGeotext extracts mentions of countries and…
permissive · top 15,000 on PyPI
geonamescacheProvides Python dictionaries of geographic data…
permissive · top 5,000 on PyPI
placekeyConverts between Placekeys (location…
permissive · top 15,000 on PyPI
pyzipcodeProvides local lookup of US ZIP code…
permissive · top 15,000 on PyPI
opencageA Python wrapper for the OpenCage Geocoding API…
permissive · top 15,000 on PyPI
geocoderGeocoder provides a unified Python interface to…
permissive · top 5,000 on PyPI