diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..924bc64 --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1774253057, + "narHash": "sha256-oOzhWWce/WDRCKwboNVFZFGrW2k6DkqKa1fpbHElfnA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "cac0a36ee2b638ea3ef4d177159bd8ce8935f7a4", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/main.py b/main.py new file mode 100644 index 0000000..31b0afa --- /dev/null +++ b/main.py @@ -0,0 +1,23 @@ +import datetime +from typing import List +from pyhafas import HafasClient +from pyhafas.profile import IVBProfile +from pyhafas.types.fptf import Leg + +client = HafasClient(IVBProfile()) + +locations = client.locations("Anichstraße") +best_found_location = locations[0] +print(best_found_location) +print("======================================") + +departures = client.departures( + station=best_found_location, + date=datetime.datetime.now(), + max_trips=1 +) +print(departures) +print(len(departures), type(departures)) +print("======================================") +for leg in departures: + print(f"Name: {leg.name}")