h3
Uber's hierarchical hexagonal geospatial indexing system
What it is and what it does
h3 is a Python binding to Uber's H3 geospatial indexing system, a C library that converts latitude/longitude coordinates into hierarchical hexagonal grid cells. It lets you discretize geographic space into a multi-resolution hexagonal hierarchy, making it straightforward to bin locations, compute spatial neighborhoods, and perform geospatial aggregations without writing C code yourself.
The package wraps the H3 core library with a Pythonic API, offering multiple input/output formats and maintaining version alignment with the underlying C library in major and minor version numbers. It has no runtime Python dependencies, installs via pre-built wheels on modern platforms, and supports Python 3.10 through 3.14. The library is actively maintained by Uber and widely used for location-based analytics, mapping, and spatial data processing.
Use it for:
- Aggregate location data into hexagonal bins for heatmaps or regional analytics dashboards.
- Find neighboring geographic cells or compute distances between locations using the H3 hierarchy.
- Discretize GPS traces or sensor readings into a consistent spatial grid for deduplication and analysis.
- Build geofencing or location-based services that need efficient spatial indexing without database overhead.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
h3 provides Python bindings to Uber's H3 geospatial indexing library, converting geographic coordinates into hierarchical hexagonal grid cells and performing spatial operations on them.
Yes. h3 is a mature, actively maintained library with zero known vulnerabilities, permissive licensing, and broad platform support via pre-built wheels. Install friction is moderate but well-managed. Use it if you need to bin geographic coordinates into a hierarchical hexagonal grid or perform spatial operations on location data.
Install
h3 on PyPI
pip
pip install h3uv
uv add h3poetry
poetry add h3Installing h3
Before you install
Medium install friction due to compiled C bindings, but well-mitigated by pre-built wheels for Python 3.10–3.14 across macOS, Linux, and Windows. Active maintenance with a recent release (76 days ago) and 1029 GitHub stars.
License in practice
Apache License 2.0 is permissive; you may use, modify, and distribute h3 freely in commercial and private projects, provided you include a copy of the license and note any changes you make.
Quickstart
pip install h3
import h3
lat, lng = 37.769377, -122.388903
cell = h3.latlng_to_cell(lat, lng, resolution=9)
print(cell) # '89283082e73ffff'
Requires Python >=3.10; compiled C extension requires a compatible build environment or pre-built wheel for your platform.
Verify before relying
- Whether the package supports multiple input/output API formats beyond the basic lat/lng_to_cell example shown in the description.
- Performance characteristics (latency, throughput) for typical geospatial workloads at scale.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 76 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,058,587/month — #1,347 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: h3-4.5.0-cp310-cp310-macosx_11_0_arm64.whl; h3-4.5.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; h3-4.5.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; h3-4.5.0-cp310-cp310-musllinux_1_2_x86_64.whl; h3-4.5.0-cp310-cp310-win_amd64.whl; h3-4.5.0-cp311-cp311-macosx_11_0_arm64.whl; h3-4.5.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; h3-4.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; h3-4.5.0-cp311-cp311-musllinux_1_2_x86_64.whl; h3-4.5.0-cp311-cp311-win_amd64.whl; h3-4.5.0-cp311-cp311-win_arm64.whl; h3-4.5.0-cp312-cp312-macosx_11_0_arm64.whl; h3-4.5.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; h3-4.5.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; h3-4.5.0-cp312-cp312-musllinux_1_2_x86_64.whl; h3-4.5.0-cp312-cp312-win_amd64.whl; h3-4.5.0-cp312-cp312-win_arm64.whl; h3-4.5.0-cp313-cp313-macosx_11_0_arm64.whl; h3-4.5.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; h3-4.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Tags
More GIS packages
Shapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
pyprojpyproj provides a Python interface to PROJ,…
permissive · top 1,000 on PyPI
geopandasGeoPandas extends pandas DataFrames to handle…
permissive · top 1,000 on PyPI
geopygeopy is a Python client for geocoding and…
permissive · top 5,000 on PyPI
pyogrioPyogrio provides fast, bulk-oriented read and…
permissive · top 5,000 on PyPI
fionaFiona reads and writes vector GIS data…
permissive · top 5,000 on PyPI
h3-pysparkProvides PySpark bindings for H3, enabling…
permissive · top 15,000 on PyPI
placekeyConverts between Placekeys (location…
permissive · top 15,000 on PyPI
s2spheres2sphere provides Python bindings to work with…
permissive · top 15,000 on PyPI
py-geohex3Converts between geographic coordinates…
permissive · top 15,000 on PyPI
python-geohashpython-geohash encodes and decodes geographic…
unclear · top 15,000 on PyPI
geolibEncodes and decodes geographic coordinates as…
permissive · top 15,000 on PyPI
rtreeRtree wraps libspatialindex to provide spatial…
permissive · top 5,000 on PyPI
pydeckPydeck provides Python bindings for deck.gl,…
permissive · top 1,000 on PyPI
pygeohashEncodes latitude/longitude coordinates to…
permissive · top 5,000 on PyPI
timezonefinderLooks up the timezone for any WGS84 coordinate…
unclear · top 5,000 on PyPI