Electrification

class pyrcs.line_data.Electrification(data_dir=None, update=False, verbose=True)[source]

A class for collecting section codes for overhead line electrification (OLE) installations.

Parameters:
  • data_dir (str | None) – Name of the data directory; defaults to None.

  • update (bool) – Whether to check for updates to the data catalogue; defaults to False.

  • verbose (bool | int) – Whether to print relevant information to the console; defaults to True.

Variables:
  • catalogue (dict) – The catalogue of the data.

  • last_updated_date (str) – The date when the data was last updated.

  • data_dir (str) – The path to the directory containing the data.

  • current_data_dir (str) – The path to the current data directory.

Examples:

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

>>> elec = Electrification()

>>> elec.NAME
'Section codes for overhead line electrification (OLE) installations'

>>> elec.URL
'http://www.railwaycodes.org.uk/electrification/mast_prefix0.shtm'

Attributes

KEY

The key for accessing the data.

KEY_TO_ETZ

The key used to reference the data of the 'UK railway electrification tariff zones'.

KEY_TO_INDEPENDENT_LINES

The key used to reference the data of the 'independent lines'.

KEY_TO_LAST_UPDATED_DATE

The key used to reference the last updated date in the data.

KEY_TO_NATIONAL_NETWORK

The key used to reference the data of the 'national network'.

KEY_TO_OHNS

The key used to reference the data of the 'overhead line electrification neutral sections (OHNS)'.

NAME

The name of the data.

URL

The URL of the main web page for the data.

Methods

collect_etz_codes([confirmation_required, ...])

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

collect_independent_lines_codes([...])

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

collect_national_network_codes([...])

Collect the section codes for Overhead Line Electrification (OLE) installations for the national network from the source web page.

collect_ohns_codes([confirmation_required, ...])

Collect codes for overhead line electrification neutral sections (OHNS) from the source web page.

fetch_codes([update, dump_dir, verbose])

Fetch OLE section codes listed in the Electrification catalogue.

fetch_etz_codes([update, dump_dir, verbose])

Fetch OLE section codes for national network energy tariff zones.

fetch_independent_lines_codes([update, ...])

Fetch OLE section codes for independent lines.

fetch_national_network_codes([update, ...])

Fetch section codes for Overhead Line Electrification (OLE) installations on the national network.

fetch_ohns_codes([update, dump_dir, verbose])

Fetch the overhead line electrification neutral sections (OHNS) codes.

get_independent_lines_catalogue([update, ...])

Get the catalogue for the independent lines.