Python wrapper for the RRTA (MyStop) REST API.
Project description
python-rrta
Python wrapper for the RRTA (MyStop) REST API.
Usage
import aiohttp
import asyncio
from rrta import RRTAClient
async def main():
session = aiohttp.ClientSession()
client = RRTAClient(session=session)
routes = await client.get_all_routes()
for route in routes:
vehicles = await client.get_vehicles(route_ids=[route.RouteId])
print(f"Route {route.RouteId}: {len(vehicles)} Vehicles")
for v in vehicles:
print(f"\t{v.VehicleId} currently en-route to {v.Destination} at {v.Speed} MPH")
if __name__ == "__main__":
asyncio.run(main())
Installation
pip install rrta
Known Issues
- Dataclasses are not pythonic at the moment and contain a bunch of member variables that RRTA doesn't seem to use despite being part of the MyStop spec
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rrta-0.1.tar.gz
(7.5 kB
view details)
Built Distribution
rrta-0.1-py3-none-any.whl
(10.4 kB
view details)
File details
Details for the file rrta-0.1.tar.gz
.
File metadata
- Download URL: rrta-0.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd5fb0d93b97b0b749fafa70781ef36e37135563ec6f18122ee81950700a2243 |
|
MD5 | 718d347f67adc8dea5dab428608f2cab |
|
BLAKE2b-256 | bb8e29e061b623f0255c873a61ff2cb388990f2e18cabe6d10a7f6ae79519bc0 |
File details
Details for the file rrta-0.1-py3-none-any.whl
.
File metadata
- Download URL: rrta-0.1-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6042d4152943859b410218351b7edd157816fad58914304c89cdb68b81380a48 |
|
MD5 | 5534bc5f22eae7260bf93954c67371d0 |
|
BLAKE2b-256 | ba96b858b6aff4a358d21ef67b7353ae602d95e6ddbe2195bad6ca6570183593 |