Skip to main content

Tools for accessing Metro Transit data

Project description

Metro Transit Python SDK

A community-built Python SDK for accessing Metro Transit's NexTrip data.

>>> from metrotransit import Client
>>> from metrotransit.api.nex_trip import get_nextrip_route_id_direction_id_place_code as get_details

>>> client = Client(base_url="https://svc.metrotransit.org")

# Get upcoming trips for the westbound Green Line at East Bank Station
>>> get_details.sync('902', 0, 'EABK', client=client)
NexTripResult(...)

Total Downloads Supported Versions GitHub last commit

Installation

The SDK is available on PyPI. Install it with your preferred package manager:

$ uv add metrotransit
$ pip install metrotransit

The SDK officially supports Python 3.10+.

Documentation

Every path/method combo in the official spec is represented as a Python module with four functions, and all parameters can be provided with method arguments:

  • sync: Blocking request that returns parsed data (if successful) or None
  • sync_detailed: Blocking request that always returns a Request, optionally with parsed set if the request was successful.
  • asyncio: Like sync but async instead of blocking
  • asyncio_detailed: Like sync_detailed but async instead of blocking

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

metrotransit-0.1.2.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

metrotransit-0.1.2-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file metrotransit-0.1.2.tar.gz.

File metadata

  • Download URL: metrotransit-0.1.2.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metrotransit-0.1.2.tar.gz
Algorithm Hash digest
SHA256 48617292959adab478a5d5174a6134e0ab09e47d667e82f6ff018a4762e1c3be
MD5 3fb84e0f0ac64bd9d11210d81ec7af53
BLAKE2b-256 ce935dbbca519a3e67547c1103b7783dcb842c07f6c5d664861e79ecf126574c

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrotransit-0.1.2.tar.gz:

Publisher: publishing.yml on bsoyka/metrotransit-sdk

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

File details

Details for the file metrotransit-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: metrotransit-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metrotransit-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abf16ac0b81146c601730e5486f8a9f7c9200a141571eadb622c31b9ab1936c4
MD5 3467a1c4e9b57bb921884c335b1a9a62
BLAKE2b-256 190fa97574e893722bc8d3f3632255656a344946941fbad1b72f18319b25a849

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrotransit-0.1.2-py3-none-any.whl:

Publisher: publishing.yml on bsoyka/metrotransit-sdk

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