============================ FsHafas-Python documentation ============================ .. toctree:: :maxdepth: 2 :caption: Contents: fshafas fshafas.profiles fshafas.fable_modules.fs_hafas_python FsHafas-Python is a client for the `HAFAS `_ public transport APIs. It is generated (via `Fable `_) by the `fshafas `_ F# library. Example ------- Get journeys between locations and print start station, end station and departure time. .. code:: Python import asyncio import sys from fshafas import HafasClient from fshafas.profiles import db_profile async def main(argv) -> int: with HafasClient(db_profile) as client: journeys = await client.journeys(argv[0], argv[1]) for j in journeys.journeys: for l in j.legs: print(l.origin.fields[0].name, l.destination.fields[0].name, l.departure) return 0 if __name__ == "__main__": if len(sys.argv) == 3: asyncio.run(main(sys.argv[1:])) .. code:: shell python3.10 example.py Hamburg Berlin Installation ------------ .. code:: shell pip install https://github.com/bergmannjg/fshafas/releases/download/2.3.0/fshafas-0.0.23-py3-none-any.whl