Electrification.collect_etz_codes(confirmation_required=True, verbose=False)[source]

Collect OLE section codes for national network energy tariff zones from source web page.

  • 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


OLE section codes for national network energy tariff zones

Return type:

dict or None


>>> from pyrcs.line_data import Electrification  # from pyrcs import Electrification

>>> elec = Electrification()

>>> rail_etz_codes = elec.collect_etz_codes()
To collect section codes for OLE installations: national network energy tariff zones
? [No]|Yes: yes
>>> type(rail_etz_codes)
>>> list(rail_etz_codes.keys())
['National network energy tariff zones', 'Last updated date']

'National network energy tariff zones'

>>> rail_etz_codes_dat = rail_etz_codes[elec.KEY_TO_ENERGY_TARIFF_ZONES]
>>> type(rail_etz_codes_dat)
>>> list(rail_etz_codes_dat.keys())
['Railtrack', 'Network Rail']

>>> rail_etz_codes_dat['Railtrack']['Codes']
   Code                   Energy tariff zone
0    EA                          East Anglia
1    EC                 East Coast Main Line
2    GE                      Great Eastern †
3    LT                                LTS †
4    MD                    Midland Main Line
5    ME                         Merseyside †
6    MS  Merseyside (North West DC traction)
7    NE                           North East
8    NL           North London (DC traction)
9    SC                             Scotland
10   SO                                South
11   SW                           South West
12   WA                        West Anglia †
13   WC                West Coast/North West