Reusable NYC geography resources, normalization helpers, and boundary loaders for Python tools.
Project description
nyc-geo-toolkit
Reusable NYC geography resources, normalization helpers, and boundary loaders for Python tools.
Authored by Blaise Albis-Burdige.
What this package provides
nyc-geo-toolkit packages canonical NYC boundary layers and the stable helper
API needed to discover, normalize, load, subset, and convert them.
It is designed to stay small, typed, and reusable across NYC data packages.
The package currently provides:
- packaged boundary layers for boroughs, community districts, council districts, NTAs, ZCTAs, and census tracts
- canonical normalization helpers for layer names and boundary values
- typed boundary models for boundary collections and features
- GeoJSON and optional DataFrame / GeoDataFrame helpers
- bbox clipping for typed boundary collections
Ecosystem
nyc-geo-toolkit is the shared geography core for the NYC package ecosystem. It
already powers the geography layer in
nyc311 and is intended to support
additional consumer packages without forcing each project to duplicate boundary
data or normalization rules.
Install
Base install:
pip install nyc-geo-toolkit
With pandas helpers:
pip install "nyc-geo-toolkit[dataframes]"
With geopandas + shapely helpers:
pip install "nyc-geo-toolkit[spatial]"
With all optional helpers:
pip install "nyc-geo-toolkit[all]"
Quick example
from nyc_geo_toolkit import list_boundary_layers, load_nyc_boundaries
print(list_boundary_layers())
queens = load_nyc_boundaries("borough", values="Queens")
print(queens.features[0].geography_value)
Examples
The repo now also ships self-contained consumer examples under examples/:
examples/boundary-quickstart/examples/normalization-demo/
Public surface
The stable public API is the top-level nyc_geo_toolkit namespace.
Discovery and loading:
list_boundary_layers()list_boundary_values()load_boundaries()load_nyc_boundaries()load_nyc_boundaries_geodataframe()load_nyc_census_tracts()load_nyc_council_districts()load_nyc_neighborhood_tabulation_areas()
Normalization:
normalize_borough_name()normalize_boundary_layer()normalize_boundary_value()normalize_boundary_values()
Conversion and spatial helpers:
boundaries_to_geojson()boundaries_to_dataframe()clip_boundaries_to_bbox()
Models and constants:
BoundaryCollectionBoundaryFeatureBoundaryLayerSpecBOROUGH_*SUPPORTED_BOROUGHSSUPPORTED_BOUNDARY_GEOGRAPHIES
Private underscore-prefixed modules are implementation details and may change without notice.
Documentation
Docs: Home, Getting Started, API Reference, Architecture, Contributing, Releasing, Changelog
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 nyc_geo_toolkit-0.1.7.tar.gz.
File metadata
- Download URL: nyc_geo_toolkit-0.1.7.tar.gz
- Upload date:
- Size: 8.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3b50f49b6dfffbe8b86c6eae2a888de84a91181eec0975e3a3cd16923b9f79a
|
|
| MD5 |
8a69ea19167d33031b173f198ca03ac9
|
|
| BLAKE2b-256 |
1d0f6c2f9bbffc1aa6f05e5018664af9c7d8eaadc45171b8c4949b13245a6ec5
|
Provenance
The following attestation bundles were made for nyc_geo_toolkit-0.1.7.tar.gz:
Publisher:
cd.yml on random-walks/nyc-geo-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nyc_geo_toolkit-0.1.7.tar.gz -
Subject digest:
a3b50f49b6dfffbe8b86c6eae2a888de84a91181eec0975e3a3cd16923b9f79a - Sigstore transparency entry: 1244753919
- Sigstore integration time:
-
Permalink:
random-walks/nyc-geo-toolkit@24f79a66bd0052cbe9595c9694a6aa4aa63c3b62 -
Branch / Tag:
refs/tags/0.1.7 - Owner: https://github.com/random-walks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@24f79a66bd0052cbe9595c9694a6aa4aa63c3b62 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nyc_geo_toolkit-0.1.7-py3-none-any.whl.
File metadata
- Download URL: nyc_geo_toolkit-0.1.7-py3-none-any.whl
- Upload date:
- Size: 8.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1de94e99ad5af4c05376c4d36bffcda645503ea9918b82b40773d9ff2ff797e7
|
|
| MD5 |
f1c9a9796bc9a192ae3a3c05c809c493
|
|
| BLAKE2b-256 |
7188f4ed9a2dbb6d8d191c8e585205d993f7f7c9f92b0980c0acf2431085fc6d
|
Provenance
The following attestation bundles were made for nyc_geo_toolkit-0.1.7-py3-none-any.whl:
Publisher:
cd.yml on random-walks/nyc-geo-toolkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nyc_geo_toolkit-0.1.7-py3-none-any.whl -
Subject digest:
1de94e99ad5af4c05376c4d36bffcda645503ea9918b82b40773d9ff2ff797e7 - Sigstore transparency entry: 1244753926
- Sigstore integration time:
-
Permalink:
random-walks/nyc-geo-toolkit@24f79a66bd0052cbe9595c9694a6aa4aa63c3b62 -
Branch / Tag:
refs/tags/0.1.7 - Owner: https://github.com/random-walks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@24f79a66bd0052cbe9595c9694a6aa4aa63c3b62 -
Trigger Event:
release
-
Statement type: