Electrification.fetch_national_network_codes

Electrification.fetch_national_network_codes(update=False, pickle_it=False, data_dir=None, verbose=False)

Fetch OLE section codes for national network from local backup.

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

  • pickle_it (bool) – whether to save the data as a pickle file, defaults to False

  • data_dir (str or None) – name of a folder where the pickle file is to be saved, defaults to None

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

Returns

OLE section codes for National network

Return type

dict or None

Example:

>>> from pyrcs.line_data import Electrification

>>> elec = Electrification()

>>> # nn_dat = elec.fetch_national_network_codes(update=True, verbose=True)
>>> nn_dat = elec.fetch_national_network_codes()

>>> type(nn_dat)
dict
>>> list(nn_dat.keys())
['National network', 'Last updated date']

>>> print(elec.NationalNetworkKey)
National network

>>> national_network_codes = nn_dat[elec.NationalNetworkKey]

>>> type(national_network_codes)
dict
>>> list(national_network_codes.keys())
['Traditional numbering system distance and sequence',
 'New numbering system km and decimal',
 'Codes not certain confirmation is welcome',
 'Suspicious data',
 'An odd one to complete the record',
 'LBSC/Southern Railway overhead system',
 'Codes not known']