Electrification.fetch_etz_codes¶
- Electrification.fetch_etz_codes(update=False, dump_dir=None, verbose=False)[source]¶
Fetches OLE section codes for national network energy tariff zones.
- Parameters:
update (bool) – Whether to check for updates to the package data; defaults to
False
.dump_dir (str | None) – Path to a directory where the data file will be saved; defaults to
None
.verbose (bool | int) – Whether to print relevant information to the console; defaults to
False
.
- Returns:
A dictionary of 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