leftshift / python_mvg_api

Yet another library for fetching MVG departures.
https://pypi.org/project/mvg-api/
MIT License
65 stars 18 forks source link

add function to get lines served for a station #27

Closed aaearon closed 3 years ago

aaearon commented 3 years ago

The departures endpoint returns two lists: departures, which returns next departures for a given station id, and servingLines which returns all the lines served at a given station id. This adds get_lines which takes a station_id and returns all the line served at that station returned in servingLines.

As info: Despite each object in the results having a destination, both directions of a line are seemingly represented by only a single line in the api's response.

leftshift commented 3 years ago

Sorry for not responding to this earlier. I like it, hadn't noticed this earlier so I think this was added to the api resonse at some point, so thank you for poking around and adding this!

My only worry is that they might remove or change this at some point, as this information seems to not be used by the website and the API hasn't been super stable in general, but then again, this similarly affects all other features of this library.