get_site_map

pyrcs.parser.get_site_map(update=False, confirmation_required=True, verbose=False, raise_error=True)[source]

Get the railway codes project site map representation data.

Retrieves database structure configuration values from a cached copy if available, or shifts to live web extraction streams depending on user parameter profiles.

Parameters:
  • update (bool) – Whether to check for updates to the package data. Defaults to False.

  • confirmation_required (bool) – Whether user confirmation is required before proceeding. Defaults to True.

  • verbose (bool | int) – Whether to print relevant information to the console. Defaults to False.

  • raise_error (bool) – Whether to raise the provided exception; if raise_error=False, the error will be suppressed. Defaults to True.

Returns:

A dictionary containing the data of site map, or None if retrieval failed.

Return type:

dict | None

Examples:

>>> from pyrcs.parser import get_site_map

>>> site_map = get_site_map()

>>> type(site_map)
dict
>>> list(site_map.keys())
['Home',
 'Line data',
 'Other assets',
 '"Legal/financial" lists',
 'Miscellaneous']

>>> site_map['Home']
{'index': 'http://www.railwaycodes.org.uk/index.shtml'}