Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Queries for VAG public transportation time schedules

Project description

===== vagquery

Build Status Coverage Status

A python library for generating and executing queries for the VAG public transport system start.vag.de

This enables users with disabilities, hackers and you to receive information from the start.vag website.

General usage

Two classes are usually used:

    import vagquery
    # Query for stations beginning with 'Schwe'
    stations = vagquery.StationQuery("Schwe").query()
    for station in stations:
        print(station)


    # Query for next departures of the main railway station (id: 510)
    departures = vagquery.DepartureQuery(510).query()
    for departure in departures:
        print(departure)

Specialized usage

For repeated queries, the query object can be created and run again and again:

    dquery = vagquery.DepartureQuery(510)
    departures = dquery.query()
    # ...
    # much later
    # ...
    departures = dquery.query()

For a custom formating of the departures, the properties of a departure object can be used:

    departures = vagquery.DepartureQuery(510).query()
    for departure in departures:
        print(departure.product + " " + str(departure.latitude) + str(departure.longitude))

License

vagquery is licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
vagquery-1.1-py2.py3-none-any.whl (7.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3
vagquery-1.1.tar.gz (3.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page