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

Uploaded CPython 3.10+Windows x86-64

transitio-0.1.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.1.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.1.0-cp310-abi3-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

transitio-0.1.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.1.0.tar.gz.

File metadata

  • Download URL: transitio-0.1.0.tar.gz
  • Upload date:
  • Size: 69.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.1.0.tar.gz
Algorithm Hash digest
SHA256 2fe46977cc371a29f086ad291d156914687cbeda5d6f373effcc1397e5d0ea38
MD5 fd62446af2decdaaf76744deb3e48ee0
BLAKE2b-256 0b61f55a03a121f25f45e2a820753dc450f68ce9f3ac97c84ce9ec123fe8f53d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: transitio-0.1.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.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6df312e90942fba6b0b1ebf0fcfffcc1ffcc009175267eea73fdc0cbb7fd972e
MD5 bff9ed7f7ae823747a563901b16a24bb
BLAKE2b-256 d7bd4d8c3c403fe114eb00b3dfe3ad1fcb108f530306861c5f27a880a5835733

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for transitio-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d5e6e5b8b82ec1f18439ce0b7ed1d83ab6e58c86b9bbcfd151b51e55e9cd3c66
MD5 838f36d4737e3ba499f0b35a53e877c2
BLAKE2b-256 657dde216bac056e48c3a88af30eeeef471ed37573f0e339bce843f936a565d1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for transitio-0.1.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 81361432e7808bf1489644b539f7614fc9ff7e1b0e68072aafbdd159c25e8c92
MD5 2460cf41708446233119fc0c73b05470
BLAKE2b-256 bbd47be4d1450168e8cf45a324fe1fd1cf54ac471b4edf85b8876d061ce2b6cc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for transitio-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d65e808ae975e7abc1fde7a4b8067d913b6e656d724d10ba88f35be624b0dcbe
MD5 06a9d2f1629b94d94f84f15b3e105823
BLAKE2b-256 2a6b9b21dccd5e6557a1fc1033e5b87a34e80d576f30709b661e34a94876d8c5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for transitio-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c3015f4feae89bd7370ea1e23ec27f0f7036f52a57ca4759b0c37c2b4e51a864
MD5 4e5f8c00dc682d6018d1637ef2ba9399
BLAKE2b-256 8093a0d59bcce39825ad245e263727c588890ac6c8dd8c2b2631b22f25f2703c

See more details on using hashes here.

Provenance

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