h3-toolkit
A Polars-native toolkit for aggregating and visualizing geospatial data using Uber's H3 spatial indexing system.
Documentation: https://h3-toolkit.readthedocs.io/
Installation
pip install h3-toolkit
# With visualization support (pydeck, mapclassify)
pip install h3-toolkit[vis]
Quick Example
import geopandas as gpd
from h3_toolkit import H3Toolkit
from h3_toolkit.aggregation import Mean, Sum
# Load your vector data (e.g., census blocks, building footprints)
gdf = gpd.read_file("your_data.geojson")
result = (
H3Toolkit()
.process_from_vector(gdf, resolution=9)
.set_aggregation_strategy({
"population": Sum(),
"income": Mean(),
})
.get_result()
)
print(result)
# shape: (n, 3)
# ┌─────────────────┬────────────┬────────┐
# │ cell ┆ population ┆ income │
# │ --- ┆ --- ┆ --- │
# │ u64 ┆ f64 ┆ f64 │
# ╞═════════════════╪════════════╪════════╡
# │ 613194865823… ┆ 1204.0 ┆ 52300. │
# └─────────────────┴────────────┴────────┘
Features
- Polars-native — all aggregations run on Polars, no pandas overhead
- Chainable API — compose
process_from_vector,set_aggregation_strategy, andget_resultin a single pipeline - Multiple input formats — vector (GeoDataFrame), raster, or existing H3 cells
- Pluggable aggregation strategies —
Sum,Mean,Count,EqualSplit,Centroid, and more - Optional visualization — built-in pydeck-based map rendering via the
visextra
Contributing
Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.
License
MIT © City Science Lab @ TaipeiTech, Syuan-Bo Huang
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
h3_toolkit-0.3.16.tar.gz
(20.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file h3_toolkit-0.3.16.tar.gz.
File metadata
- Download URL: h3_toolkit-0.3.16.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.0.1 CPython/3.12.2 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
354af16b29600684983ffa406d1125bd51f555ca3524bc5c0fb8b32a9cd4e680
|
|
| MD5 |
69af0e53531482d6fe0a1c1f7d543c24
|
|
| BLAKE2b-256 |
794729adf3ae18f1020385b3d789f84893efff38621a7ea3a8eb161309d383ea
|
File details
Details for the file h3_toolkit-0.3.16-py3-none-any.whl.
File metadata
- Download URL: h3_toolkit-0.3.16-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
poetry/2.0.1 CPython/3.12.2 Darwin/25.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68cc7d5b9e8fead798a1192c836d968abb121792f8b45e58df6a3438722f7805
|
|
| MD5 |
21712434a7ad251087b57ea6573b72a3
|
|
| BLAKE2b-256 |
e890eb4bed7aa73a7d36fe19427e146f90af96967b2ec1f748e75443a6300f2f
|