Stations.collect_station_data_by_initial

Stations.collect_station_data_by_initial(initial, update=False, verbose=False)

Collect data of railway station locations for the given initial letter.

Parameters
  • initial (str) – initial letter of locations of the railway station data

  • update (bool) – whether to do an update check (for the package data), defaults to False

  • verbose (bool or int) – whether to print relevant information in console, defaults to False

Returns

data of railway station locations beginning with initial and date of when the data was last updated

Return type

dict

Example:

>>> from pyrcs.other_assets import Stations

>>> stn = Stations()

>>> # sa = stn.collect_station_data_by_initial('a', update=True, verbose=True)
>>> sa = stn.collect_station_data_by_initial(initial='a')

>>> type(sa)
dict
>>> list(sa.keys())
['A', 'Last updated date']

>>> sa['A'].head()
      Station   ELR  ... Prev_Operator_6 Prev_Operator_Period_6
0  Abbey Wood   NKL  ...
1  Abbey Wood  XRS3  ...
2        Aber   CAR  ...
3   Abercynon   CAM  ...
4   Abercynon   ABD  ...
[5 rows x 28 columns]