daft-h3
Native H3 geospatial indexing functions for Daft.
Installation
pip install daft-h3
Usage
import daft
import daft_h3
from daft import col
daft.load_extension(daft_h3)
df = daft.from_pydict({"lat": [37.7749, 48.8566], "lng": [-122.4194, 2.3522]})
df = df.select(daft_h3.h3_latlng_to_cell(col("lat"), col("lng"), 7).alias("cell"))
df = df.select(daft_h3.h3_cell_to_str(col("cell")).alias("hex"))
df.show()
All cell-input functions accept both UInt64 and Utf8 (hex string) columns, so you can operate directly on string H3 data without an explicit conversion step. Functions that return cell indices preserve the input type: string in, string out.
For maximum throughput, convert to UInt64 once at the top of a pipeline with h3_str_to_cell and operate on integers throughout.
h3_cell_to_str also accepts a list column of cells and returns List(Utf8), so you can compute in UInt64 and persist as strings (useful for Iceberg/Trino/Spark, which lack unsigned types and will reinterpret UInt64 cell IDs as negative signed values):
df = df.select(
h3_cell_to_str(h3_grid_disk(col("cell"), 1)).alias("neighbors_hex")
)
Functions
| Function | Input | Output |
|---|---|---|
h3_latlng_to_cell |
lat (f64), lng (f64), resolution (0-15) | UInt64 |
h3_cell_to_lat |
cell (UInt64 or Utf8) | Float64 |
h3_cell_to_lng |
cell (UInt64 or Utf8) | Float64 |
h3_cell_to_str |
cell or List of cells (UInt64 or Utf8) | Utf8 or List(Utf8) |
h3_str_to_cell |
hex (Utf8) | UInt64 |
h3_cell_resolution |
cell (UInt64 or Utf8) | UInt8 |
h3_cell_is_valid |
cell (UInt64 or Utf8) | Boolean |
h3_cell_parent |
cell (UInt64 or Utf8), resolution (0-15) | same as input |
h3_grid_distance |
a (UInt64 or Utf8), b (UInt64 or Utf8) | Int32 |
h3_grid_disk |
cell (UInt64 or Utf8), k (≥ 0) | List(UInt64 or Utf8) |
h3_grid_ring |
cell (UInt64 or Utf8), k (≥ 0) | List(UInt64 or Utf8) |
Invalid cell indices produce null. Resolution is validated at plan time.
Performance
Benchmarked against wrapping the h3 Python library in a @daft.func.batch UDF (1M rows, hex string columns, Apple M-series):
| Function | daft-h3 | UDF (h3-py) | Speedup |
|---|---|---|---|
latlng_to_cell |
416ms | 1,407ms | 3.4x |
cell_to_lat |
242ms | 1,011ms | 4.2x |
cell_parent |
75ms | 1,072ms | 14.4x |
cell_resolution |
47ms | 767ms | 16.4x |
str_to_cell |
46ms | 756ms | 16.6x |
Development
git clone https://github.com/gweaverbiodev/daft-h3.git
cd daft-h3
uv sync --extra dev --extra test
make install-hooks
Requires Rust (stable), Python >= 3.10, and uv.
make install-hooks # Install pre-commit git hooks
make develop # Install the extension in editable mode (uv pip install -e)
make check # Fast Rust type-check (cargo check)
make build # Release build (cargo build --release)
make lint # Check formatting and types
make format # Auto-fix and format
make test # Run tests
Metadata
Release files for daft-h3 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| daft_h3-0.2.0.tar.gz | 64.6 kB | Details |
Built distributions (wheels)
Total release size: 8.1 MB
Release files / daft_h3-0.2.0.tar.gz
| Download URL | daft_h3-0.2.0.tar.gz |
|---|---|
| Size | 64.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
526c29000a2a5be6cd78560e0a51b20161b8c071b8a35ccb9f6bdee6a0f438b8
|
|
BLAKE2b-256 checksum How to use checksums |
c0948debcf6752130adaf576dae32f369d2edf40c0c0e81f6d89a4be7ed3f57d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | daft_h3-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 527.4 kB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
bf34fcdeee45735953c21a83bbeac3707ed41e0cd1d430334e324ec367ec2560
|
|
BLAKE2b-256 checksum How to use checksums |
7132d44e766ae1d16f86894f44a43039fc946587a2edc3a61fa5dd98ff3de3f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl
| Download URL | daft_h3-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 507.4 kB |
| Tags | CPython 3.13 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
e151ba9fc472ea4deb6fad34abaf0d28f0b6f14c445ecc4a2d244130911cbe67
|
|
BLAKE2b-256 checksum How to use checksums |
e1360276c4dcd0f08b974d163978327d7d227f5791f9f459f7492445124e65b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | daft_h3-0.2.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 463.8 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1e4105580652a835d856be18f03942f4e176e1a8ea56408b5192eebcf02f8223
|
|
BLAKE2b-256 checksum How to use checksums |
ee05e623213073471cb016e5814886d1d6cffa356905e616e3eda52368f9079d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | daft_h3-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 500.9 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
7d02cf0f9113ccc3b011140e44f5c0821ea0d8625de943b925ca1d5fac0fef33
|
|
BLAKE2b-256 checksum How to use checksums |
336c4f504c56128da9643c6ed296a566f0efa0919e321346d5a18144ba5ccf3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | daft_h3-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 527.4 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9b098a87818ec51e69a10e97ac1340356ab1f35ca7725c32dd9dd2bedab92fed
|
|
BLAKE2b-256 checksum How to use checksums |
b505756778e4b2e632c4970c2cd9e42cb08942de7b0df43fd39398cb3dda3506
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl
| Download URL | daft_h3-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 507.4 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
40aebb2797cdbd51334c9c03343c58b549d3caba20c34ac018771b62d54cae46
|
|
BLAKE2b-256 checksum How to use checksums |
b3489e11eb7ce6ef5e327795d9e4000d0aab783ad6f3f2c88c709521ef1e2547
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | daft_h3-0.2.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 463.8 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ff10070e00a6cce1a4b5dc69129bc2f66be2a6cef7be5d3598c18bac2db26d54
|
|
BLAKE2b-256 checksum How to use checksums |
c26b24ed4706e07d37d66fe56a464666c019c2afb54b91b8d2f1538dcadf82b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | daft_h3-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 500.9 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
00b8a095384409433f89186ea33994fa5124e574ee63a19d253eba5f78b6f7d3
|
|
BLAKE2b-256 checksum How to use checksums |
3d5418c2e37246cd0fab125cf8df054a8d3cba6caa37327756a9473d04c7fa98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | daft_h3-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 527.4 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
7609c8bab2f76d854738b5228e49e410a06d6c3d8a2b25500fda9f8735a0f394
|
|
BLAKE2b-256 checksum How to use checksums |
af80088c1c93eafdbf5d9c7ed5fdd5b9bd198ba9036aa062c9641c6da42727cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp311-cp311-manylinux_2_28_aarch64.whl
| Download URL | daft_h3-0.2.0-cp311-cp311-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 507.4 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
84ad43f34da682f383dc4dd2cab9b40944375d4cef08393877186f0964f7fe16
|
|
BLAKE2b-256 checksum How to use checksums |
75616e81df41dd980e170f1563a1b7ddc75571f3654da7b3a368cdaccca70e4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | daft_h3-0.2.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 463.8 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b39a1e7aa95ef63d061dfcadd019f94dc410f1b56697956fc49fc505d35626b4
|
|
BLAKE2b-256 checksum How to use checksums |
9bb186d4f1c6b6716bb94b8fd1455edeb783919be562168e53fbf350aa25e285
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp311-cp311-macosx_10_13_x86_64.whl
| Download URL | daft_h3-0.2.0-cp311-cp311-macosx_10_13_x86_64.whl |
|---|---|
| Size | 500.9 kB |
| Tags | CPython 3.11 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
e82d70189ba59d5fb0c086a1f7ee60efe2bf80320e381b9d1bfbed5608e49d15
|
|
BLAKE2b-256 checksum How to use checksums |
4d03fb426232f397d9aa9bb922554445bfccd31d89f32d481d56bbbfb67264bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | daft_h3-0.2.0-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 527.4 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0eb9c5adb66c2e8eb04707b1bd0efa1df6e3a62c663f7f0462ad3ed93e65f82b
|
|
BLAKE2b-256 checksum How to use checksums |
135a91553e1a0c806cfa5326a96e3dcf3c5db4f75141a29b308a54135f4fbb84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp310-cp310-manylinux_2_28_aarch64.whl
| Download URL | daft_h3-0.2.0-cp310-cp310-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 507.4 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
c53e9a8a0d1da202ff393f9ce50b25e465e27bf515177a3ac313d51679c4f12a
|
|
BLAKE2b-256 checksum How to use checksums |
386fe9ddfb2d194c069df90b7eef748cfc5f887b0230b451b7d76221b2f97bb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | daft_h3-0.2.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 463.8 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
118e4ed41694fab79a6c64d641530bce73e2434ffcb56192b311fade11e76924
|
|
BLAKE2b-256 checksum How to use checksums |
7952a2b6a8cda88f6f5f07d53b85eaa86f902a135e3244d6b901c6a3e655c616
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / daft_h3-0.2.0-cp310-cp310-macosx_10_13_x86_64.whl
| Download URL | daft_h3-0.2.0-cp310-cp310-macosx_10_13_x86_64.whl |
|---|---|
| Size | 500.9 kB |
| Tags | CPython 3.10 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
867c5d3e45aba7fd87f280a1ce9cd1b8ae3c94a80dd166d937d896617df226b0
|
|
BLAKE2b-256 checksum How to use checksums |
21e307539f3dc4b32f94f6c826a1eba92ab19392a367c0d8385e3e5eeb204d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency log