Get transport information from opendata.rmv.de
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(stationId='3006907',
products=['S', 'U-Bahn', 'Tram'],
maxJourneys=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.1.2.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for PyRMVtransport-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a626e0affc1b9b040d93afbc76da88b191c246649d7923b6bb0bf4b5afdeb4b7 |
|
MD5 | 51d250b52979ff8619186e4ca8477ec7 |
|
BLAKE2b-256 | 499cf84d26f064c3a532da37ea5896e5b02231de3367bd7ba7b823f906ea838f |