SignalBoxes.fetch_wr_mas_dates¶
- SignalBoxes.fetch_wr_mas_dates(update=False, dump_dir=None, verbose=False, **kwargs)[source]¶
Fetches data of WR (western region) MAS (multiple aspect signalling) dates.
- Parameters:
update (bool) – Whether to check for updates to the package data; defaults to
False
.dump_dir (str | None) – The 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 containing the data of WR MAS dates and the date when they were last updated.
- Return type:
dict
Examples:
>>> from pyrcs.other_assets import SignalBoxes # from pyrcs import SignalBoxes >>> sb = SignalBoxes() >>> sb_wr_mas_dates = sb.fetch_wr_mas_dates() >>> type(sb_wr_mas_dates) dict >>> list(sb_wr_mas_dates.keys()) ['WR MAS dates', 'Last updated date'] >>> sb.KEY_TO_WRMASD 'WR MAS dates' >>> sb_wr_mas_dates_dat = sb_wr_mas_dates[sb.KEY_TO_WRMASD] >>> type(sb_wr_mas_dates_dat) collections.defaultdict >>> list(sb_wr_mas_dates_dat.keys())[:5] ['Paddington-Hayes', 'Birmingham', 'Plymouth', 'Reading-Hayes', 'Newport Multiple Aspect Signalling'] >>> sb_wr_mas_dates_dat['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