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.4.0.tar.gz (89.1 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.4.0-cp310-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

transitio-0.4.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.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

transitio-0.4.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.4.0.tar.gz.

File metadata

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

File hashes

Hashes for transitio-0.4.0.tar.gz
Algorithm Hash digest
SHA256 47dbe189a5c6fca3e15c227bd4840bba8eaef9182235beb7840e247b721d108d
MD5 63ce698b94af95f6f71c42caab1677cf
BLAKE2b-256 66ddc9d38a9d69b95d95fe14eceaa1821cc9f3d1d5e6eabbdb1b20f2794987d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.4.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.4.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: transitio-0.4.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.4.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5247036755afb0e1ce8a4ea46fbde126c9245200efb40a3055cd3b784bbf2276
MD5 1db65048638f008a0dd6ec0e2cfe8296
BLAKE2b-256 74365d0b8a75e11fc2d869e92376e23a9e5fe91eccf8da75976d2a73cc4df354

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.4.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.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for transitio-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d43797379e0b3f09616916be0f162351c25eca1e2b3616124e990704e7b2caba
MD5 61d015e4673ff060d721fc95d7bf6873
BLAKE2b-256 34b6da336464ec9909d87ea2515579281a735be070ca423318a30bcfddde0654

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.4.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.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for transitio-0.4.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 49fcd0ee155b9bd01c65033f033aea2ec7e2bc2bc6ebdecf1b18ccf635b157dd
MD5 8a533a53f7dfedf4764f94a2c024e529
BLAKE2b-256 a2e1d4b1878eaca3976de90d1c679a4576036a5326fb3150c72ba6b761bf19fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.4.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.4.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for transitio-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a1af96017feb2ea41407d9404655e1f54a522dbf6377e887d800eba37cf0be7e
MD5 f26d8907e05f0d9bb64f332e44e5acd3
BLAKE2b-256 066960836a72e50cb3adb5e41b74453b779afd00c2ddc33fd4fd5747005a0e0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.4.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.4.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for transitio-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 24a07f643b68aff6f92ec809768c9a8b8d2c81c07775db041c0f8b4152c5d791
MD5 885d11c97e1ae838a73530a1c23c41c9
BLAKE2b-256 78d19343d4c54dccde10f6a4b5eaefcb5f9059bebddc82e8b50c698edfbcca3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for transitio-0.4.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