Bridges.collect_codes¶
- Bridges.collect_codes(confirmation_required=True, verbose=False)[source]¶
Collects the codes of railway bridges from the source webpage.
- Parameters:
confirmation_required (bool) – Whether to prompt for confirmation before proceeding; defaults to
True
.verbose (bool | int) – Whether to print relevant information in 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 collected.- Return type:
dict | None
Examples:
>>> from pyrcs.line_data import Bridges # from pyrcs import Bridges >>> bdg = Bridges() >>> bdg_codes = bdg.collect_codes() To collect data of railway bridges ? [No]|Yes: yes >>> 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'}