geolib
A library for geohash encoding, decoding and associated functions
What it is and what it does
Geolib is a Python port of Chris Veness' geohash library, providing tools to convert between geographic coordinates (latitude/longitude) and geohash strings—a compact spatial encoding scheme. It supports encoding coordinates to geohashes at variable precision levels, decoding geohashes back to coordinate pairs, and computing neighboring cells and directional bounds for spatial proximity operations.
The library is designed for applications that need efficient spatial indexing or proximity queries without heavy dependencies. It depends only on the future package for Python 2/3 compatibility. However, the project is abandoned and has not been updated since 2019, so it may lack support for modern Python versions and will not receive maintenance or bug fixes.
Use it for:
- Build a location-based service that groups nearby coordinates into grid cells for efficient spatial queries.
- Implement a map tile or spatial database index using geohashes to partition geographic data.
- Find all geohash neighbors of a given location to identify adjacent regions in a grid-based system.
- Compress latitude/longitude pairs into short strings for storage or transmission in location-aware applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes geographic coordinates as geohashes, and computes neighboring cells and directional bounds for spatial indexing and proximity queries.
Yes, if you need geohash encoding/decoding for a stable, non-critical feature and can accept an unmaintained package. The code is simple and low-friction to install, and the MIT license is permissive. No, if you require active maintenance, support for the latest Python versions, or bug fixes—consider a maintained alternative or fork.
Install
geolib on PyPI
pip
pip install geolibuv
uv add geolibpoetry
poetry add geolibInstalling geolib
Before you install
Low install friction with a single lightweight dependency (future). However, the package is abandoned—last release was 2019-05-04 and no commits since 2023-05-26. It will not receive bug fixes or updates for modern Python versions.
License in practice
MIT license (permissive) allows free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install geolib
from geolib import geohash
# Encode latitude, longitude to geohash
code = geohash.encode('70.2995', '-27.9993', 7)
print(code) # 'gkkpfve'
# Decode geohash back to coordinates
lat, lon = geohash.decode('gkkpfve')
print(lat, lon) # (70.2995, -27.9993)
# Find neighboring cells
neighbours = geohash.neighbours('gcpuyph')
print(neighbours.ne) # 'gcpuypm'
Verify before relying
- Whether the package works reliably on Python versions released after 2019 or if modern dependency versions introduce incompatibilities.
- Whether the port from Chris Veness' JavaScript implementation has been validated against the original for edge cases or precision issues.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — future |
| Maintenance | abandoned — 2,659 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 139,113/month — #11,308 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: geolib-1.0.7-py3-none-any.whl
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
geohash2Encodes latitude/longitude coordinates to…
agpl · top 5,000 on PyPI
python-geohashpython-geohash encodes and decodes geographic…
unclear · top 15,000 on PyPI
pygeohashEncodes latitude/longitude coordinates to…
permissive · top 5,000 on PyPI
py-geohex3Converts between geographic coordinates…
permissive · top 15,000 on PyPI
s2spheres2sphere provides Python bindings to work with…
permissive · top 15,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
reverse-geocodeReverse Geocode converts latitude/longitude…
copyleft · top 15,000 on PyPI
reverse_geocoderReverse Geocoder converts latitude/longitude…
copyleft · top 15,000 on PyPI
pgeocodepgeocode queries postal codes to retrieve GPS…
permissive · top 5,000 on PyPI