Skip to main content

A simple interface to the WMATA API

Project description

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 emma@emma.sh

License

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

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for wmata, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size wmata-1.0.0-py3-none-any.whl (28.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size wmata-1.0.0.tar.gz (22.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page