Stations.collect_station_data_by_initial

Stations.collect_station_data_by_initial(initial, update=False, verbose=False)[source]

Collect railway station data for the given initial letter.

Parameters
  • initial (str) – initial letter of station data (including the station name, ELR, mileage, status, owner, operator, degrees of longitude and latitude, and grid reference) for specifying URL

  • update (bool) – whether to check on update and proceed to update the package data, defaults to False

  • verbose (bool, int) – whether to print relevant information in console as the function runs, defaults to False

Returns

railway station data for the given initial letter and date of when the data was last updated

Return type

dict

Example:

>>> from pyrcs.other_assets import Stations

>>> stn = Stations()

>>> stn_data_a = stn.collect_station_data_by_initial(initial='a')

>>> type(stn_data_a)
<class 'dict'>
>>> print(list(stn_data_a.keys()))
['A', 'Last updated date']