SignalBoxes.fetch_ireland_codes

SignalBoxes.fetch_ireland_codes(update=False, dump_dir=None, verbose=False)[source]

Fetches the data of Irish signal cabin prefix codes.

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 Irish signal cabin prefix codes and the date when they were last updated.

Return type:

dict

Examples:

>>> from pyrcs.other_assets import SignalBoxes  # from pyrcs import SignalBoxes
>>> sb = SignalBoxes()
>>> ireland_sb_codes = sb.fetch_ireland_codes()
>>> type(ireland_sb_codes)
dict
>>> list(ireland_sb_codes.keys())
['Ireland', 'Notes', 'Last updated date']
>>> sb.KEY_TO_IRELAND
'Ireland'
>>> ireland_sb_codes_dat = ireland_sb_codes[sb.KEY_TO_IRELAND]
>>> type(ireland_sb_codes_dat)
pandas.core.frame.DataFrame
>>> ireland_sb_codes_dat.head()
   Code Signal Cabin                    Note
0    AD     Adelaide
1    AN       Antrim
2    AE      Athlone
3  AE R                      Distant signals
4    XG               Level crossing signals