-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexamples.py
32 lines (23 loc) · 870 Bytes
/
examples.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
import asyncio
from pprint import pprint
from apyefa import EfaClient, LocationFilter
async def main():
async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
result = await asyncio.gather(
client.info(),
client.locations_by_name("Nürnberg Plärrer"),
client.locations_by_name("Nordostbahnhof", filters=[LocationFilter.STOPS]),
client.departures_by_location(
"de:09564:704", limit=10, date="20241126 16:30"
),
)
print("System Info".center(60, "-"))
pprint(result[0])
print("Plärrer stops".center(60, "-"))
pprint(result[1])
print("Nordostbahnhof stops".center(60, "-"))
pprint(result[2])
print("Plärrer departures - 26 Nov. 16:30".center(60, "-"))
pprint(result[3])
if __name__ == "__main__":
asyncio.run(main())