0
Fork 0
mirror of https://github.com/uber/h3-py.git synced 2026-11-16 07:44:46 +00:00
Python bindings for H3, a hierarchical hexagonal geospatial indexing system https://uber.github.io/h3-py
  • Python 70.2%
  • Cython 27.3%
  • CMake 1.8%
  • Just 0.7%
Find a file
Jongbin Jung cb852ab893
Merge pull request #515 from jongbinjung/fix-coverage-identity-binding
Exclude identity-binding block from coverage to fix CI on master
History 2026-11-13 15:54:06 -08:00
.github/workflows Add CI test and build for Python 3.15 and 3.15t 2026-10-09 17:49:47 -07:00
docs Bump h3lib to v4.4.1 and add new functions/errors (#470) 2025-11-22 08:17:21 -08:00
src Exclude identity-binding block from coverage 2026-11-13 15:43:39 -08:00
tests Merge pull request #504 from connerkup/fix/501-identity-out-scalar-wrapper 2026-11-13 15:14:23 -08:00
.gitignore v4.5a (alpha version) (#483) 2026-02-26 14:12:54 -08:00
.gitmodules The big Cython move (#99) 2020-05-10 11:47:45 -07:00
CHANGELOG.md Add missing items from changelog 2026-11-13 14:08:01 -08:00
CMakeLists.txt build: detect Buildozer environment to fix Android cross-compilation 2026-07-07 15:23:28 +05:30
dev_notes.md updates readme.md clone instructions (#489) 2026-04-19 22:24:41 -07:00
justfile v4.5a (alpha version) (#483) 2026-02-26 14:12:54 -08:00
LICENSE first commit 2018-07-30 12:24:17 -07:00
pyproject.toml Add CI test and build for Python 3.15 and 3.15t 2026-10-09 17:49:47 -07:00
readme.md Prep for v4.5.0 release 2026-05-29 09:15:58 -07:00

H3 Logo

h3-py: Uber's H3 Hexagonal Hierarchical Geospatial Indexing System in Python

PyPI version PyPI downloads conda version version

Tests Coverage 100%

Python bindings for the H3 core library.

Installation

From PyPI:

pip install h3

From conda:

conda config --add channels conda-forge
conda install h3-py

Usage

>>> import h3
>>> lat, lng = 37.769377, -122.388903
>>> resolution = 9
>>> h3.latlng_to_cell(lat, lng, resolution)
'89283082e73ffff'

APIs

We provide multiple APIs in h3-py.

Browse a collection of example notebooks, and if you have examples or visualizations of your own, please feel free to contribute!

We also have an introductory walkthrough of the API.

Versioning

h3-py wraps the H3 core library, which is written in C. The C and Python projects each employ semantic versioning, where versions take the form X.Y.Z.

The h3-py version string is guaranteed to match the C library string in both major and minor numbers (X.Y), but may differ on the patch (Z) number. This convention provides users with information on breaking changes and feature additions, while providing downstream bindings (like this one!) with the versioning freedom to fix bugs.

Use h3.versions() to see the version numbers for both h3-py and the C library. For example,

>>> import h3
>>> h3.versions()
{'c': '4.1.0', 'python': '4.1.1'}