Bridges

class pyrcs.line_data.Bridges(data_dir=None, update=False, verbose=True)[source]

A class for collecting data of railway bridges.

Parameters:
  • data_dir (str | None) – Directory where the data is stored; defaults to None.

  • verbose (bool | int) – Whether to print relevant information to the console; defaults to True.

Variables:
  • catalogue (dict) – The catalogue of the data.

  • last_updated_date (str) – The date when the data was last updated.

  • data_dir (str) – The path to the directory containing the data.

  • current_data_dir (str) – The path to the current data directory.

Examples:

>>> from pyrcs.line_data import Bridges  # from pyrcs import Bridges
>>> bdg = Bridges()
>>> bdg.NAME
'Railway bridges'
>>> bdg.URL
'http://www.railwaycodes.org.uk/bridges/bridges0.shtm'

Attributes

KEY

The key for accessing the data.

KEY_TO_LAST_UPDATED_DATE

The key used to reference the last updated date in the data.

NAME

The name of the data.

URL

The URL of the main webpage for the data.

Methods

collect_codes([confirmation_required, ...])

Collects codes of railway bridges from its source webpage.

fetch_codes([update, dump_dir, verbose])

Fetches codes of railway bridges.