Metadata-Version: 2.4
Name: metrotransit
Version: 0.1.2
Summary: Tools for accessing Metro Transit data
Author: Ben Soyka
Author-email: Ben Soyka <hello@bsoyka.me>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Dist: httpx>=0.23.0,<0.29.0
Requires-Dist: attrs>=25.4.0
Requires-Dist: python-dateutil>=2.8.0,<3.0.0
Requires-Dist: typing-extensions>=4.0.0,<5.0.0
Requires-Python: >=3.10
Project-URL: Changelog, https://github.com/bsoyka/metrotransit-py/releases
Project-URL: Sponsor, https://github.com/sponsors/bsoyka
Description-Content-Type: text/markdown

# Metro Transit Python SDK

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

```python
>>> 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](https://img.shields.io/pepy/dt/metrotransit)][pypi]
[![Supported Versions](https://img.shields.io/pypi/pyversions/metrotransit.svg)][pypi]
[![GitHub last commit](https://img.shields.io/github/last-commit/bsoyka/metrotransit-sdk)][github]

## Installation

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

```sh
$ 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

[github]: https://github.com/bsoyka/metrotransit-sdk
[pypi]: https://pypi.org/project/metrotransit/
