Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Station ID in vvspy >= v2.0.0 #64

Open
zaanposni opened this issue May 19, 2024 · 0 comments
Open

Get Station ID in vvspy >= v2.0.0 #64

zaanposni opened this issue May 19, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@zaanposni
Copy link
Owner

zaanposni commented May 19, 2024

replaces #12

In Version 2, we've introduced the Station enum, providing a more structured approach to utilizing the VVS API by replacing string identifiers.

Change

### OLD
from vvspy import get_departures

deps = get_departures("5006115", limit=3)  # Stuttgart main station
### NEW
from vvspy import get_departures
from vvspy.enums import Station

deps = get_departures(Station.HAUPTBAHNHOF__TIEF)

Data completeness

Please note that the enum might not encompass all stations you seek. This limitation arises from parsing an older CSV resource to compile the enum.

Also note that there may be multiple stations with the same name for different cities, directions and types of transport.

Get your station identifier manually

  • Explore the CSV files located in the data directory.
  • Check the browser requests on vvs.de when searching for a station or requesting a connection
@zaanposni zaanposni self-assigned this May 19, 2024
@zaanposni zaanposni pinned this issue May 19, 2024
@zaanposni zaanposni added the documentation Improvements or additions to documentation label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant