Electrification.fetch_codes¶
- Electrification.fetch_codes(update=False, dump_dir=None, verbose=False)[source]¶
Fetches OLE section codes listed in the Electrification catalogue.
- 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 the section codes for OLE installations.
- Return type:
dict
Examples:
>>> from pyrcs.line_data import Electrification # from pyrcs import Electrification >>> elec = Electrification() >>> elec_codes = elec.fetch_codes() >>> type(elec_codes) dict >>> list(elec_codes.keys()) ['Electrification', 'Last updated date'] >>> elec.KEY 'Electrification' >>> elec_codes_dat = elec_codes[elec.KEY] >>> type(elec_codes_dat) dict >>> list(elec_codes_dat.keys()) ['National network energy tariff zones', 'Independent lines', 'National network', 'National network neutral sections']