-
Notifications
You must be signed in to change notification settings - Fork 20
/
example.py
37 lines (31 loc) · 1.01 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import datetime
from pyhafas import HafasClient
from pyhafas.profile import DBProfile, VSNProfile
client = HafasClient(DBProfile(), debug=True)
print(client.departures(
station='8000128',
date=datetime.datetime.now(),
max_trips=5
))
print(client.arrivals(
station='8005556',
date=datetime.datetime.now(),
max_trips=5
))
print(client.journey('¶HKI¶T$A=1@O=Berlin Jungfernheide@L=8011167@a=128@$A=1@O=Berlin Hbf (tief)@L=8098160@a=128@$202002101544$202002101549$RB 18521$$1$§T$A=1@O=Berlin Hbf (tief)@L=8098160@a=128@$A=1@O=München Hbf@L=8000261@a=128@$202002101605$202002102002$ICE 1007$$1$'))
print(client.journeys(
destination="8000207",
origin="8005556",
date=datetime.datetime.now(),
min_change_time=0,
max_changes=-1
))
print(client.locations("Köln Hbf"))
print(client.trip("1|1372374|3|80|9062020"))
print('='*20)
vsn = HafasClient(VSNProfile())
print(vsn.departures(
station='9034033',
date=datetime.datetime.now(),
max_journeys=5
))