Skip to content

lines_by_location

Alex Jung edited this page Jan 1, 2025 · 1 revision

Find lines pass provided location.

Arguments

Arguments Type Required Description
location str | Location required The location passed by searched line(s)
req_types list[LineRequestType] optional The result presentation type(s) can be defined with this argument. Default value is []

Return value

Type Description
list[Line] List of lines found for provided location

Examples

async with EfaClient("https://efa.vgn.de/vgnExt_oeffi/") as client:
    lines: list[Line] = await client.lines_by_location("de:09564:704")

    print(f"Found {len(lines)} line(s)")
    print(f"id         : {lines[0].id}")
    print(f"name       : {lines[0].name}")
    print(f"description: {lines[0].description}")
    print(f"product    : {lines[0].product}")

    # OUTPUT:
    # Found 10 line(s)
    # id         : vgn:33283: :H:j24
    # name       : 283
    # description: Hugenottenplatz - St. Johann - Dechsendorfer Weiher
    # product    : <TransportType.BUS: 5>