Install & Compatibility
Where this runs
tested against v0.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.3s · import 0.344s · 98MB
103MB installed
● package 103MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
polygon_to_geohashes
✓ from polygon_geohasher import polygon_to_geohashes
✗ from polygon_geohasher.polygon_geohasher import polygon_to_geohashes
Top-level imports are available since 0.0.2
geohash_to_polygon
✓ from polygon_geohasher import geohash_to_polygon
Direct top-level import works
geohashes_to_polygon
✓ from polygon_geohasher import geohashes_to_polygon
Direct top-level import works
Basic usage: create polygon, convert to geohashes, convert back.
from shapely.geometry import Polygon
from polygon_geohasher import polygon_to_geohashes, geohash_to_polygon, geohashes_to_polygon
# Create a simple polygon (a square near London)
polygon = Polygon([(-0.1, 51.5), (-0.1, 51.6), (0.1, 51.6), (0.1, 51.5)])
# Convert polygon to geohashes (default precision 5)
geohashes = polygon_to_geohashes(polygon, precision=5)
print('Geohashes:', geohashes[:5], '...') # prints first 5
# Convert single geohash to polygon (bounding box)
if geohashes:
poly = geohash_to_polygon(geohashes[0])
print('Polygon from geohash:', poly.wkt)
# Convert list of geohashes to polygon
poly_union = geohashes_to_polygon(list(geohashes))
print('Union polygon:', poly_union.wkt)
Errors
Common errors & fixes
ImportError: cannot import name 'polygon_to_geohashes' from 'polygon_geohasher'
Older version (<0.0.2) did not expose top-level imports; you need to import from polygon_geohasher.polygon_geohasher
fixUpgrade to latest version: pip install --upgrade polygon-geohasher, or use old import: from polygon_geohasher.polygon_geohasher import polygon_to_geohashes
TypeError: 'Polygon' object is not iterable
Passing a single polygon instead of a list to geohashes_to_polygon; this function expects a list/iterable of geohash strings.
fixPass a list: geohashes_to_polygon([geohash_string])
AttributeError: module 'polygon_geohasher' has no attribute 'polygon_to_geohashes'
Using very old version (before 0.0.2) or incorrectly installed package.
fixpip install --upgrade polygon-geohasher and check import path: from polygon_geohasher import polygon_to_geohashes
Upgrade
Version history
0.0.2latest on PyPI · released Feb 11, 2026
Audit
Dependencies
shapelyrequiredCore dependency for polygon geometry operations
geohashrequiredFor encoding/decoding geohashes