Bridges.fetch_codes¶
- Bridges.fetch_codes(update=False, dump_dir=None, verbose=False, **kwargs)[source]¶
Fetches 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
Noneif no data is retrieved.- Return type:
dict | None
Examples:
>>> from pyrcs.line_data import Bridges # from pyrcs import Bridges >>> bdg = Bridges() >>> bdg_codes: dict = bdg.fetch_codes() >>> list(bdg_codes.keys()) ['Bridges', 'Last updated date'] >>> bdg_data = bdg_codes['Bridges'] >>> list(bdg_data.keys()) ['East Coast Main Line', 'Midland Main Line', 'West Coast Main Line', 'Scotland', 'Elizabeth Line', 'London Overground', 'Anglia', 'London Underground', 'Key to text presentation conventions'] >>> bdg_data['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'}