Skip to main content

API Wrapper for VVS (Verkehrsverbund Stuttgart)

Project description

VVS API Wrapper

Checkup status

Fully object-oriented library to integrate the VVS API into your project.

Installation

pip install vvspy

Requirement: Python 3.6 or higher

Examples

  • Detect delay in upcoming departures:
from vvspy import get_departures

deps = get_departures("5006115", limit=3)  # Stuttgart main station
for dep in deps:
    if dep.delay > 0:
        print("Alarm! Delay detected.")
        print(dep)  # Timestamp @ Station: Train: Origin - Destination
  • Get complete trip info between two stations (including interchanges):
from vvspy import get_trips

trips = get_trips("5000355", "5005600", limit=1)  # Stuttgart main station
for trip in trips:
    print(f"Duration: {trip.duration / 60} minutes")
    for connection in trip.connections:
        print(f"From: {connection.origin.name} - To: {connection.destination.name}")
# Output:
Duration: 58 minutes
From: Wallgraben - To: Hauptbf (A.-Klett-Pl.)
From: Hauptbf (Arnulf-Klett-Platz) - To: Stuttgart Hauptbahnhof (tief)
From: Stuttgart Hauptbahnhof (tief) - To: Marbach (N)
From: Marbach (N) Bf - To: Murr Hardtlinde
  • Filter for specific lines:
from vvspy import get_departures

deps = get_departures("5006118")  # Stuttgart main station (lower)
for dep in deps:
    if dep.serving_line.symbol == "S4":
        print(f"Departure of S4 at {dep.real_datetime}")

Features

  • [x] fully object oriented results

  • [ ] full customizable requests and parameters # coming soon

  • [x] parsing all available info into result obj

  • [x] Well tested and maintained

  • [x] Departures, Arrivals, Trips, Station info, Upcoming events, Maintenance work

  • See issues/projects on GitHub for upcoming features

Contributors

License:

This project is licensed under MIT.

Project details


Download files

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

Files for vvspy, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size vvspy-0.2.1.tar.gz (63.3 kB) File type Source Python version None Upload date Hashes View hashes

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