Python-Library for accessing online train connection APIs (Elektronische Fahrplanauskunft).
A list of supported regions can be found here.
Just install it from the Python Package Index:
pip install pyefa3
from pyefa.classes import Station
from pyefa.networks import DING
origin_station = Station()
origin_station.name = "Theater"
origin_station.place = "Ulm"
destination_station = Station()
destination_station.name = "Universität Süd"
destination_station.place = "Ulm"
efa_api = DING()
result = efa_api.tripRequest(origin_station, destination_station, apitype="xml")
print(result)
machine_readable = result.asdict()
The Python-Modules beautifulsoup4 and colorama are required.
Just clone the repository and run:
python setup.py install
Documentation is available via docstrings.
pydoc clifa
pydoc clifa.classes
# and so on