Skip to main content

No project description provided

Project description

pymbta3

Python wrapper for the MBTA v3 API

Install

pip install pymbta3

Usage

To get data from the MBTA API, import the library and call the object with your API key. The API Key may also be stored in the environment variable MBTA_API_KEY.

from pymbta3.alerts import Alerts

at = Alerts(key=YOUR_API_KEY_HERE)

# Find all alerts affecting the Red Line at Alewife
alerts = at.get_alert(route='Red', stop='place-alfcl')

# Find the short header for the alert
for alert in alerts['data']:
    print(alert['attributes']['short_header'])

Multiple values can be passed in for most lists.

# Alerts affecting Orange and Red lines
alerts = at.get_alert(route=['Orange', 'Red'])
# find all alerts affecting parking or Wheelchair use
alerts = at.get_alert(activity=['PARK_CAR', 'USING_WHEELCHAIR'])

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymbta3-0.0.1.dev0-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pymbta3-0.0.1.dev0-py2.py3-none-any.whl.

File metadata

  • Download URL: pymbta3-0.0.1.dev0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for pymbta3-0.0.1.dev0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a2c96ff707bb2b8a9b510d5cdb669da7579b86448e185c2e9c167b659dd87802
MD5 67526960c7021400f41f1e4cc38b5ca6
BLAKE2b-256 96c8ecd6e61ba1b2700636f3c00516e8107a4910f38a11adea6b0808a4fb0a10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page