First working stuff!!!
This commit is contained in:
parent
271017e89f
commit
c48d5bb387
2 changed files with 49 additions and 0 deletions
23
main.py
Normal file
23
main.py
Normal 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}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue