Пример #1
0
def test_db_journey_request():
    client = HafasClient(DBProfile())
    journey = client.journey(
        journey=
        "¶HKI¶T$A=1@O=Siegburg/Bonn@L=8005556@a=128@$A=1@O=Troisdorf@L=8000135@a=128@$202008081507$202008081512$S     19$$1$$$c",
    )
    assert isinstance(journey, Journey)
Пример #2
0
def test_db_journey_request():
    client = HafasClient(DBProfile())
    journey = client.journey(
        journey=
        "¶HKI¶T$A=1@O=Siegburg/Bonn@L=8005556@a=128@$A=1@O=Hennef(Sieg)@L=8002753@a=128@$202106051440$202106051445$S     12$$1$$$",
    )
    assert isinstance(journey, Journey)
Пример #3
0
def test_vsn_journey_request():
    client = HafasClient(VSNProfile())
    journey = client.journey(
        journey=
        "¶HKI¶T$A=1@O=Lenglern Bahnhof@L=9909403@a=128@$A=1@O=Göttingen Bahnhof/ZOB@L=1101000@a=128@$202106051527$202106051550$Bus 220 $$1$$$$",
    )
    assert isinstance(journey, Journey)
Пример #4
0
def test_vsn_journey_request():
    client = HafasClient(VSNProfile())
    journey = client.journey(
        journey=
        "¶HKI¶T$A=1@O=Göttingen@L=8000128@a=128@$A=1@O=Lenglern@L=8003644@a=128@$202008090710$202008090719$    RB85$$1$$$",
    )
    assert isinstance(journey, Journey)
Пример #5
0
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',