WMATA is an easy to use Python interface to the Washington Metropolitan Area Transit Authority API.
- Python 3.8
pip install wmatafrom wmata import MetroRail, Station
client = MetroRail(api_key)
trains = client.next_trains(Station["A01"])WMATA breaks the WMATA API into two components: MetroRail and MetroBus.
Provides access to all MetroRail related endpoints.
import wmata
client = wmata.MetroRail(api_key)
trains = client.next_trains(wmata.Station["A01"])Provides access to all MetroBus related endpoints.
from wmata import MetroBus
client = MetroBus(api_key)
routes = client.routes()Run
python setup.py testTests use VCRpy to avoid network requests.
- Requests
- VCRpy
Feel free to email questions and comments to emma@emma.sh
WMATA is released under the MIT license. See LICENSE for details.