Skip to content

emma-k-alexandra/pywmata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b11e851 · Dec 29, 2019

History

3 Commits
Dec 28, 2019
Dec 28, 2019
Dec 5, 2019
Dec 5, 2019
Dec 5, 2019
Dec 28, 2019
Dec 28, 2019
Dec 29, 2019

Repository files navigation

WMATA

WMATA is an easy to use Python interface to the Washington Metropolitan Area Transit Authority API.

Contents

Requirements

  • Python 3.8

Installation

pip install wmata

Usage

Getting Started

from wmata import MetroRail, Station

client = MetroRail(api_key)

trains = client.next_trains(Station["A01"])

Design

WMATA breaks the WMATA API into two components: MetroRail and MetroBus.

MetroRail

Provides access to all MetroRail related endpoints.

Using MetroRail
import wmata

client = wmata.MetroRail(api_key)

trains = client.next_trains(wmata.Station["A01"])

MetroBus

Provides access to all MetroBus related endpoints.

Using MetroBus
from wmata import MetroBus

client = MetroBus(api_key)

routes = client.routes()

Testing

Run

python setup.py test

Tests use VCRpy to avoid network requests.

Dependencies

  • Requests

Dev Dependencies

  • VCRpy

Contact

Feel free to email questions and comments to [email protected]

License

WMATA is released under the MIT license. See LICENSE for details.