SignalBoxes

class pyrcs.other_assets.sig_box.SignalBoxes(data_dir=None, update=False, verbose=True)

A class for collecting data of signal box prefix codes.

Parameters
  • data_dir (str or None) – name of data directory, defaults to None

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

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

Variables
  • catalogue (dict) – catalogue of the data

  • last_updated_date (str) – last updated date

  • data_dir (str) – path to the data directory

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

Examples:

>>> from pyrcs.other_assets import SignalBoxes  # from pyrcs import SignalBoxes

>>> sb = SignalBoxes()

>>> sb.NAME
'Signal box prefix codes'

>>> sb.URL
'http://www.railwaycodes.org.uk/signal/signal_boxes0.shtm'

Attributes

KEY

Key of the dict-type data

KEY_TO_BELL_CODES

Key of the dict-type data of 'bell codes'

KEY_TO_IRELAND

Key of the dict-type data of 'Ireland'

KEY_TO_LAST_UPDATED_DATE

Key of the data of the last updated date

KEY_TO_NON_NATIONAL_RAIL

Key of the dict-type data of 'non-national rail'

KEY_TO_WRMASD

Key of the dict-type data of 'WR (Western region) MAS (multiple aspect signalling) dates'

NAME

Name of the data

URL

URL of the main web page of the data

Methods

collect_bell_codes([confirmation_required, ...])

Collect data of bell codes from source web page.

collect_ireland_codes([...])

Collect data of Irish signal cabin prefix codes from source web page.

collect_non_national_rail_codes([...])

Collect signal box prefix codes of non-national rail from source web page.

collect_prefix_codes(initial[, update, verbose])

Collect signal box prefix codes beginning with a given initial letter from source web page.

collect_wr_mas_dates([...])

Collect data of WR (western region) MAS (multiple aspect signalling) dates from source web page.

fetch_bell_codes([update, dump_dir, verbose])

Fetch data of bell codes.

fetch_ireland_codes([update, dump_dir, verbose])

Fetch data of Irish signal cabin prefix codes.

fetch_non_national_rail_codes([update, ...])

Fetch signal box prefix codes of non-national rail.

fetch_prefix_codes([update, dump_dir, verbose])

Fetch data of signal box prefix codes.

fetch_wr_mas_dates([update, dump_dir, verbose])

Fetch data of WR (western region) MAS (multiple aspect signalling) dates.