Bridges.fetch_codes

Bridges.fetch_codes(update=False, dump_dir=None, verbose=False)[source]

Fetches the codes of railway bridges.

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 railway bridge data and the date of the last update, or None if no data is retrieved.

Return type:

dict | None

Examples:

>>> from pyrcs.line_data import Bridges  # from pyrcs import Bridges
>>> bdg = Bridges()
>>> bdg_codes = bdg.fetch_codes()
>>> type(bdg_codes)
dict
>>> list(bdg_codes.keys())
['East Coast Main Line',
 'West Coast Main Line',
 'Scotland',
 'Elizabeth Line',
 'London Overground',
 'Anglia',
 'London Underground',
 'Addendum',
 'Key to text presentation conventions']
>>> bdg_codes['Key to text presentation conventions']
{'Bold': 'Existing bridges',
 'Bold italic': 'Existing locations',
 'Light italic': 'Former/historical locations',
 'Red': 'Stations',
 'Deep red': 'Level crossings',
 'Brown': 'Ventilation shafts',
 'Purple': 'Junctions',
 'Black,grey': 'Bridges and culverts',
 'Green': 'Tunnel portals',
 'Bright blue': 'Viaducts',
 'Deep blue': 'Boundaries'}