Skip to content

Installation

bikescore-bna requires Python 3.11+.

Install the package

$ pip install bikescore-bna

or, in a uv-managed project:

$ uv add bikescore-bna

This pulls the scientific stack it depends on (GeoPandas, Shapely, pyproj, SciPy, NumPy, pandas/polars, PyArrow) plus pygris (US census geometry) and requests (data acquisition). The library carries no web or database dependencies — it runs entirely in-process.

OSM clipping (trimming the regional PBF to the city boundary) shells out to the osmium-tool command-line program when it is on PATH. It is substantially faster than the pure-Python fallback (pyosmium, ~8× slower), which is used automatically when osmium is not found.

# Debian/Ubuntu
$ sudo apt install osmium-tool
# macOS
$ brew install osmium-tool

For a single region, everything works without it — the binary only affects acquisition speed, never results.

Required for multi-region acquisition

Acquiring a city whose analysis extent crosses a state line — anything with extra_regions — merges the Geofabrik extracts with osmium merge, which has no pyosmium fallback. That path requires the osmium CLI and raises a clear error if it is missing. See Data acquisition → Multi-region acquisition.

Verify

$ bikescore-bna scenarios
default
$ python -c "import bikescore_bna; print(bikescore_bna.__version__)"
0.1.0