SignalBoxes.collect_wr_mas_dates

SignalBoxes.collect_wr_mas_dates(confirmation_required=True, verbose=False, raise_error=False)[source]

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

Parameters:
  • confirmation_required (bool) – Whether user confirmation is required; if confirmation_required=True (default), prompts the user for confirmation before proceeding with data collection.

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

  • raise_error (bool) – Whether to raise the provided exception; if raise_error=False (default), the error will be suppressed.

Returns:

A dictionary containing the data of WR MAS dates and the date when they were last updated, or None if no data is collected.

Return type:

dict | None

Examples:

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

>>> sb = SignalBoxes()

>>> sb_wr_mas_dates: dict = sb.collect_wr_mas_dates(verbose=True)
Proceed with collecting data of "WR MAS dates"?
 [No]|Yes: yes
Collecting the data ... Done.

>>> list(sb_wr_mas_dates)
['WR MAS dates', 'Last updated date']

>>> sb_wr_mas_dates_dict = sb_wr_mas_dates['WR MAS dates']

>>> list(sb_wr_mas_dates_dict)[:5]
['Paddington-Hayes',
 'Birmingham',
 'Plymouth',
 'Reading-Hayes',
 'Newport Multiple Aspect Signalling']

>>> sb_wr_mas_dates_dict.get('Paddington-Hayes')
  Stage             Date                        Area
0    1A    12 April 1953               Hayes-Hanwell
1    1B    20 March 1955        Hanwell-Acton Middle
2    1C  1 February 1959  Acton West-Friars Junction