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


Download files

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

Source Distribution

wmata-1.0.0.tar.gz (22.6 kB view hashes)

Uploaded source

Built Distribution

wmata-1.0.0-py3-none-any.whl (28.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page