python-geohash
Fast, accurate python geohashing library
What it is and what it does
python-geohash is a library for converting geographic coordinates (latitude/longitude) into geohash strings—compact, hierarchical representations of locations. Geohashes are useful for spatial indexing, proximity searches, and storing location data efficiently in databases. The library uses a Rust extension (via PyO3) for speed, though it can fall back to a pure-Python implementation if needed.
The package has been maintained since 2009 and is actively developed; version 0.9.0 switched from a C/C++ extension to Rust. It supports both encoding (coordinates to geohash) and decoding (geohash back to coordinates), making it suitable for applications that need fast, accurate location-based operations.
Use it for:
- Index geographic locations in a database for fast spatial queries and proximity searches.
- Compress latitude/longitude pairs into short strings for URLs, APIs, or storage.
- Group nearby locations by shared geohash prefixes for clustering or regional analysis.
- Build location-based services that need to find points within a certain distance of a query location.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
python-geohash encodes and decodes geographic coordinates into compact geohash strings for spatial indexing and proximity queries.
Yes, with conditions. The package is actively maintained, has no known vulnerabilities, and is widely used. Install friction is moderate due to the compiled extension, but prebuilt wheels are available for common platforms. Verify the exact Python version support and confirm the license terms (Apache License 2.0, MIT License, or New BSD License) match your project's requirements before committing.
Install
python-geohash on PyPI
pip
pip install python-geohashuv
uv add python-geohashpoetry
poetry add python-geohashInstalling python-geohash
Before you install
Medium install friction due to a compiled Rust extension (PyO3-based). The package is actively maintained with a recent release 73 days ago and no known vulnerabilities. Prebuilt wheels are available for common platforms, reducing build-time friction for standard environments.
License in practice
License treatment is unclear: the package states it is licensed under Apache License 2.0, MIT License, and New BSD License, but PyPI metadata does not specify which applies. Verify the LICENSE file in the repository to confirm the exact terms before use.
Quickstart
pip install python-geohash
import geohash
encoded = geohash.encode(latitude, longitude)
decoded = geohash.decode(encoded)
Requires a compatible CPU architecture; prebuilt wheels are available for manylinux2014 x86_64, but other architectures may require compilation.
Verify before relying
- Exact Python version support range (requires_python is unspecified in metadata)
- Whether the Rust extension is optional or required for core functionality
- Performance characteristics compared to pure-Python fallback (mentioned in description)
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 73 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 560,758/month — #6,001 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_geohash-0.9.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
geolibEncodes and decodes geographic coordinates as…
permissive · top 15,000 on PyPI
pygeohashEncodes latitude/longitude coordinates to…
permissive · top 5,000 on PyPI
geohash2Encodes latitude/longitude coordinates to…
agpl · top 5,000 on PyPI
polylineEncodes and decodes geographic coordinate…
unclear · top 5,000 on PyPI
h3h3 provides Python bindings to Uber's H3…
permissive · top 5,000 on PyPI
overpyA Python wrapper for querying the Overpass API…
permissive · top 15,000 on PyPI
py-geohex3Converts between geographic coordinates…
permissive · top 15,000 on PyPI
pyGeoTileConverts between geographic coordinate systems…
permissive · top 15,000 on PyPI
flexpolylineEncodes and decodes geographic coordinate…
permissive · top 15,000 on PyPI
gps3Provides Python clients to connect to a GPSD…
permissive · top 15,000 on PyPI