Define module-level imports.
Project description
PyRMVtransport :bus:
Python library to make use of transport information from opendata.rmv.de.
Installation
$ pip install PyRMVtransport
Usage
import asyncio
import aiohttp
from RMVtransport import RMVtransport
async def main():
"""The main part of the example script."""
async with aiohttp.ClientSession() as session:
rmv = RMVtransport(session)
# Get the data
try:
# Departures for station 3006907 (Wiesbaden Hauptbahnhof)
# max. 5 results
# only specified products (S-Bahn, U-Bahn, Tram)
data = await rmv.get_departures(station_id='3006907',
products=['S', 'U-Bahn', 'Tram'],
max_journeys=5)
# Use the JSON output
print(data)
# or pretty print
await rmv.output()
except TypeError:
pass
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
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
PyRMVtransport-0.2.9.tar.gz
(35.0 kB
view hashes)
Built Distribution
Close
Hashes for PyRMVtransport-0.2.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e299c0b17b5ab7f22d216b717574546e647ba22cc26ab3dd12298e395224abd |
|
MD5 | 54fb91cbc94a62dba66a798f8fb6bf1e |
|
BLAKE2b-256 | 7bb1c17ad0c420218b30d31e0b27e179f2490285d208eedd752a1749ef996204 |