SignalBoxes.fetch_non_national_rail_codes¶
-
SignalBoxes.
fetch_non_national_rail_codes
(update=False, pickle_it=False, data_dir=None, verbose=False)[source]¶ Fetch signal box prefix codes of non-national rail from local backup.
- Parameters
update (bool) – whether to check on update and proceed to update the package data, defaults to
False
pickle_it (bool) – whether to replace the current package data with newly collected data, defaults to
False
data_dir (str, None) – name of package data folder, defaults to
None
verbose (bool, int) – whether to print relevant information in console as the function runs, defaults to
False
- Returns
signal box prefix codes of non-national rail
- Return type
dict
Example:
>>> from pyrcs.other_assets import SignalBoxes >>> sb = SignalBoxes() >>> # nnr_codes = sb.fetch_non_national_rail_codes(update=True, verbose=True) >>> nnr_codes = sb.fetch_non_national_rail_codes() >>> type(nnr_codes) dict >>> list(nnr_codes.keys()) ['Non-National Rail', 'Last updated date'] >>> nnr_codes_ = nnr_codes['Non-National Rail'] >>> type(nnr_codes_) dict >>> list(nnr_codes_.keys()) ['Croydon Tramlink signals', 'Docklands Light Railway signals', 'Edinburgh Tramway signals', 'Glasgow Subway signals', 'London Underground signals', 'Luas signals', 'Manchester Metrolink signals', 'Midland Metro signals', 'Nottingham Tram signals', 'Sheffield Supertram signals', 'Tyne & Wear Metro signals', 'Heritage, minor and miniature railways and other "special" signals'] >>> lu_signals = nnr_codes_['London Underground signals'] >>> type(lu_signals) list >>> print(lu_signals[0].head()) Code ... Became or taken over by (where known) 0 BMX ... - 1 A ... - 2 S ... - 3 X ... - 4 R ... - [5 rows x 5 columns]