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.0.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.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metrotransit-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 c04714c96a563b9f5cd1ea13c6b40fc94e62c6ab665223ca76774a07755031f0
MD5 4c82b877a3235c8d7447949685332f7f
BLAKE2b-256 d1ec200e28579cffcd7e8f8c12023fb5b02b314d534d874090fcb4d602814037

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrotransit-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: metrotransit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8bb1d8035247f6dd3da6e53fa757277c3bd9a45837dac126dba8344c74e3ccc
MD5 86bf4f54d8a4982497764f746b35cec7
BLAKE2b-256 9076a6ef027b299ba1f76ba93230d1aa3fc4b069d758801e79ac945855a058e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for metrotransit-0.1.0-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