Bridges.fetch_codes
- Bridges.fetch_codes(update=False, dump_dir=None, verbose=False)
Fetch codes of railway bridges.
- Parameters
update (bool) – whether to do an update check (for the package data), defaults to
False
dump_dir (str or None) – pathname of a directory where the data file is dumped, defaults to
None
verbose (bool or int) – whether to print relevant information in console, defaults to
False
- Returns
data of railway bridges and date of when the data was last updated
- Return type
dict or 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'}