Skip to main content

AOI-driven OSM and GTFS acquisition, validation and repair — companion to pyrosm and cafein

Project description

transitio

AOI-driven OSM and GTFS acquisition, validation and repair — companion to pyrosm and cafein. transitio moves the raw ingredients of routing — OSM extracts and GTFS timetables — from the open data ecosystem to your area of interest, validated and repaired, ready for cafein to brew into routing results.

Status: early development. Acquisition (Mobility Database catalog + OSM extracts), GTFS validation, repair and cropping are in place, tied together by the one-call transitio.fetch pipeline.

Quick example

import transitio

# One call: OSM extract + validated GTFS feeds for an area of interest.
result = transitio.fetch(helsinki_polygon)        # any shapely geometry,
                                                   # bbox tuple or place name
result.osm_pbf     # cropped OSM extract (path)
result.feeds       # downloaded, cropped and validated GTFS feeds (paths)
result.reports     # per-feed merged validation reports
result.skipped     # (feed id, reason) for anything left out

net = result.to_cafein()   # routable cafein.TransportNetwork
osm = result.to_pyrosm()   # pyrosm.OSM reader over the extract

fetch accepts when="2026-09-01" to pick the dataset versions covering a service day (needs a free Mobility Database API token, passed as refresh_token= or via the MOBILITY_API_REFRESH_TOKEN environment variable), modes=["rail", "tram"] to keep only feeds serving given modes, and repair=True to repair feeds before use. With a token, GTFS downloads are catalogued dataset versions verified against catalog checksums; without one, the latest hosted zips are fetched as-is — unverified moving targets.

Lower-level access

Each pipeline stage is available on its own:

db = transitio.MobilityDatabase()

feeds = db.search_feeds(aoi=helsinki_polygon)
dataset = db.dataset_for(feeds[0], when="2026-09-01")
path = db.download(dataset)                        # cached, checksum-verified
report = db.validation_report(dataset)             # hosted canonical-validator report

pbf = transitio.fetch_pbf(helsinki_polygon)       # cropped OSM extract
validation = transitio.validate_feed(path)        # canonical-code notices
transitio.repair_feed(path, "repaired.zip")       # gtfstidy-contract repair
transitio.crop_feed(path, "cropped.zip", aoi=helsinki_polygon)

Documentation

The Sphinx site lives in docs/. Building it needs transitio itself installed (autodoc imports the real package) plus the Sphinx toolchain:

pip install . -r docs/requirements.txt
sphinx-build -b html docs docs/_build/html

The hosted version lives at https://transitio.readthedocs.io.

Installation

pip install transitio

Binary wheels cover Linux, macOS and Windows. Building from source instead requires a Rust toolchain (pip install .).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

transitio-0.2.0.tar.gz (83.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

transitio-0.2.0-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

transitio-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

transitio-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

transitio-0.2.0-cp310-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

transitio-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file transitio-0.2.0.tar.gz.

File metadata

  • Download URL: transitio-0.2.0.tar.gz
  • Upload date:
  • Size: 83.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for transitio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5d40c6244a6ab8fe6ebaa21096e4eab6eebf398cc4673fd69f27974b97c90bfe
MD5 4bde7b862c407341c195a2a5410681fc
BLAKE2b-256 2529500be70d9d1f8305222077c730141c5575c0a73db5e8dfb3aaa55dbece88

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.2.0.tar.gz:

Publisher: release.yaml on cafein-py/transitio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file transitio-0.2.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: transitio-0.2.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for transitio-0.2.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 937741f401b61c6c832347337eb0bdc5634123105de124980d0421d06c639766
MD5 96118e34e98ec12ce517f2a4642a3a51
BLAKE2b-256 982db82fffd9e6de8df0ff96fb69e0f346f8553c7a6430b58eb84ae619a792ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.2.0-cp310-abi3-win_amd64.whl:

Publisher: release.yaml on cafein-py/transitio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file transitio-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for transitio-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c51e92bd125346c8d2f9519982689a47efd38e9952ac22cafb42bc80b300b134
MD5 a129d03cfa6352cdf0d8e22c0cd8f289
BLAKE2b-256 3ea5bbb9142d21609492eb5368561c542f8d0dac9766cc32702eb230f71b8e89

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yaml on cafein-py/transitio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file transitio-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for transitio-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b4415324cfe187e0826fd584a8c4370d5567606bc421ac3e544ea678ec560498
MD5 705aab13a731521bfc2f571724c64bce
BLAKE2b-256 62fb180c6c8ba71887498949d79ec246a80f129c875af0479bfc5a39b934d067

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.2.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yaml on cafein-py/transitio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file transitio-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for transitio-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a9a30c371d797ff1e6569ae6670c8a031ded4fca5f94991e5f9562cdd18d2c7f
MD5 1d97dabfec6c4d0b3f939bd4fafee874
BLAKE2b-256 83b57d1fc6994124b4cfb1047ec5008ceb1d771fe85b59b75cdea3e9bdd1eae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.2.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yaml on cafein-py/transitio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file transitio-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for transitio-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bfe80259239a0a79cbbb6479580282bac47e875df94c2c7b5d479957ba4dd148
MD5 f2a7111f4366b47a0686cd2161944aea
BLAKE2b-256 3ce77215ce8cda7369bb990a513bac9bcb518ad887377efe6439d14254499971

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yaml on cafein-py/transitio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page