GitHunt
BS

bsoyka/metrotransit-sdk

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

Languages

Python100.0%

Contributors

MIT License
Created January 7, 2026
Updated January 7, 2026
bsoyka/metrotransit-sdk | GitHunt