yaschedule
Lib for getting schedule data from Yandex.Rasp API:
https://yandex.ru/dev/rasp/doc
Quick Start
Init
from yaschedule.core import YaSchedule
TOKEN = 'some string'
yaschedule = YaSchedule(TOKEN)
[optional] requests caching
See more at requests_cache docs
print(yaschedule.session.settings.expire_after)
yaschedule.session.settings.expire_after = 600
print(yaschedule.session.settings)
print({ a : getattr(yaschedule.session.settings, a) for a in dir(yaschedule.session.settings) if not a.startswith('_') })
Usage
yaschedule.get_all_stations()
city_1 = 'c213'
city_2 = 'c2'
station_1 = 's9600366'
station_2 = 's9600213'
yaschedule.get_station_schedule(station=station_1)
yaschedule.get_schedule(from_station=station_1, to_station=station_2)
yaschedule.get_schedule(from_station=city_1, to_station=city_2)
yaschedule.get_schedule(from_station=city_1, to_station=station_1)
yaschedule.get_schedule(from_station=city_1, to_station=city_2, transport_types='train')
yaschedule.get_schedule(from_station=city_1, to_station=city_2, transport_types='plane')
yaschedule.get_schedule(from_station=city_1, to_station=city_2, transfers=True)