Skip to main content

pypi License: MIT Python 3.10+

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, and get_result in 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 vis extra

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.

License

MIT © City Science Lab @ TaipeiTech, Syuan-Bo Huang

Metadata

Release files for h3-toolkit 0.3.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for h3-toolkit 0.3.16
File Size Uploaded
h3_toolkit-0.3.16.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for h3-toolkit 0.3.16
File Interpreter ABI Platform
h3_toolkit-0.3.16-py3-none-any.whl Python 3 none any Details

Total release size: 42.2 kB

Release files / h3_toolkit-0.3.16.tar.gz

Download URL h3_toolkit-0.3.16.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
354af16b29600684983ffa406d1125bd51f555ca3524bc5c0fb8b32a9cd4e680
BLAKE2b-256 checksum
How to use checksums
794729adf3ae18f1020385b3d789f84893efff38621a7ea3a8eb161309d383ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.2 Darwin/25.3.0

Release files / h3_toolkit-0.3.16-py3-none-any.whl

Download URL h3_toolkit-0.3.16-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68cc7d5b9e8fead798a1192c836d968abb121792f8b45e58df6a3438722f7805
BLAKE2b-256 checksum
How to use checksums
e890eb4bed7aa73a7d36fe19427e146f90af96967b2ec1f748e75443a6300f2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.2 Darwin/25.3.0

Release history Release notifications | RSS feed

This release

0.3.16 This release

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page