Electrification.collect_indep_lines_codes

Electrification.collect_indep_lines_codes(confirmation_required=True, verbose=False)

Collect OLE section codes for independent lines from source web page.

Parameters
  • confirmation_required (bool) – whether to confirm before proceeding, defaults to True

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

Returns

OLE section codes for independent lines

Return type

dict or None

Example:

>>> from pyrcs.line_data import Electrification

>>> elec = Electrification()

>>> il_ole_dat = elec.collect_indep_lines_codes()
To collect section codes for OLE installations: independent lines? ... yes

>>> type(il_ole_dat)
dict
>>> list(il_ole_dat.keys())
['Independent lines', 'Last updated date']

>>> print(elec.IndependentLinesKey)
Independent lines

>>> il_ole_codes = il_ole_dat[elec.IndependentLinesKey]

>>> type(il_ole_codes)
dict
>>> list(il_ole_codes.keys())[-5:]
['Seaton Tramway',
 'Sheffield Supertram',
 'Snaefell Mountain Railway',
 'Summerlee, Museum of Scottish Industrial Life Tramway',
 'Tyne & Wear Metro']