Electrification.fetch_etz_codes

Electrification.fetch_etz_codes(update=False, dump_dir=None, verbose=False)

Fetch OLE section codes for national network energy tariff zones.

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

  • dump_dir (str or None) – pathname of a directory where the data file is dumped, defaults to None

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

Returns

OLE section codes for national network energy tariff zones

Return type

dict

Examples:

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

>>> elec = Electrification()

>>> rail_etz_codes = elec.fetch_etz_codes()
>>> type(rail_etz_codes)
dict
>>> list(rail_etz_codes.keys())
['National network energy tariff zones', 'Last updated date']

>>> elec.KEY_TO_ENERGY_TARIFF_ZONES
'National network energy tariff zones'

>>> rail_etz_codes_dat = rail_etz_codes[elec.KEY_TO_ENERGY_TARIFF_ZONES]
>>> type(rail_etz_codes_dat)
dict
>>> 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