SignalBoxes¶
-
class
sig_box.
SignalBoxes
(data_dir=None, update=False, verbose=True)¶ A class for collecting signal box prefix codes.
- Parameters
data_dir (str or None) – name of data directory, defaults to
None
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
True
- Variables
Name (str) – name of the data
Key (str) – key of the dict-type data
HomeURL (str) – URL of the main homepage
LUDKey (str) – key of the last updated date
LUD (str) – last updated date
Catalogue (dict) – catalogue of the data
DataDir (str) – path to the data directory
CurrentDataDir (str) – path to the current data directory
NonNationalRailKey (str) – key of the dict-type data of non-national rail
NonNationalRailPickle (str) – name of the pickle file of non-national rail data
IrelandKey (str) – key of the dict-type data of Ireland
IrelandPickle (str) – name of the pickle file of Ireland data
WRMASDKey (str) – key of the dict-type data of WR MAS dates
WRMASDPickle (str) – name of the pickle file of WR MAS dates data
MSBKey (str) – key of the dict-type data of signal box bell codes
MSBPickle (str) – name of the pickle file of signal box bell codes
Example:
>>> from pyrcs.other_assets import SignalBoxes >>> sb = SignalBoxes() >>> print(sb.Name) Signal box prefix codes >>> print(sb.SourceURL) http://www.railwaycodes.org.uk/signal/signal_boxes0.shtm
Methods
Collect signal box prefix codes of non-national rail from source web page.
collect_prefix_codes
(initial[, update, verbose])Collect signal box prefix codes beginning with
initial
from source web page.fetch_non_national_rail_codes
([update, …])Fetch signal box prefix codes of non-national rail from local backup.
fetch_prefix_codes
([update, pickle_it, …])Fetch signal box prefix codes from local backup.