LocationIdentifiers.collect_loc_codes_by_initial

LocationIdentifiers.collect_loc_codes_by_initial(initial, update=False, verbose=False)[source]

Collect CRS, NLC, TIPLOC, STANME and STANOX codes for a given initial letter.

Parameters
  • initial (str) – initial letter of station/junction name or certain word for specifying URL

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

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

Returns

data of location codes for the given initial letter; and date of when the data was last updated

Return type

dict

Example:

>>> from pyrcs.line_data import LocationIdentifiers

>>> lid = LocationIdentifiers()

>>> location_codes_a = lid.collect_loc_codes_by_initial(initial='a')

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

>>> print(location_codes_a['A'].head())
                               Location CRS  ... STANME_Note STANOX_Note
0                                Aachen      ...
1                    Abbeyhill Junction      ...
2                 Abbeyhill Signal E811      ...
3            Abbeyhill Turnback Sidings      ...
4  Abbey Level Crossing (Staffordshire)      ...
[5 rows x 12 columns]