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() >>> non_national_rail_codes_dat = sb.fetch_non_national_rail_codes() >>> non_national_rail_codes = non_national_rail_codes_dat['Non-National Rail'] >>> type(non_national_rail_codes) <class 'dict'> >>> print(list(non_national_rail_codes.keys())[:5]) ['Croydon Tramlink signals', 'Docklands Light Railway signals', 'Edinburgh Tramway signals', 'Glasgow Subway signals', 'London Underground signals'] >>> croydon_tl_signals = non_national_rail_codes['Croydon Tramlink signals'] >>> type(croydon_tl_signals) <class 'list'> >>> print(croydon_tl_signals[0]) None >>> print(croydon_tl_signals[1]) Croydon Tramlink signal codes can be found on the ...