First working stuff!!!

This commit is contained in:
mia 2026-03-23 11:48:45 +01:00
parent 271017e89f
commit c48d5bb387
2 changed files with 49 additions and 0 deletions

26
flake.lock generated Normal file
View file

@ -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
}

23
main.py Normal file
View file

@ -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}")