VGN async API for python 3
Project description
VGN
Asynchron Python API for the Verkehrsverbund Grossraum Nuernberg (VGN).
Uses the official REST-API to query realtime public transport information for Nuremberg.
With the python 3.7 feature asyncio tasks fast and non-blocking querries are possible.
Read the docs for more information.
Example
import vgn
async def main():
res = await asyncio.gather(
api_version(),
all_stations(),
departure_schedule(704),
departure_schedule_for_line(704, "U2"),
rides(TransportType.BUS, 30),
)
print(f'Api version: {res[0]}')
print(f'Stations in nbg: {str(len(res[1]))}')
print(f'Departures at plaerrer in nbg: {res[2]}')
print(f'Departures of underground line 2 at plaerrer in nbg: {res[3]}')
print(f'Bug departures in the next 30 minutes: {res[4]}')
if __name__ == '__main__':
asyncio.run(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vgn-1.0.0.tar.gz
(6.2 kB
view hashes)
Built Distribution
vgn-1.0.0-py3-none-any.whl
(7.5 kB
view hashes)