LineNames

class line_name.LineNames(data_dir=None, update=False, verbose=True)[source]

A class for collecting British railway line names.

Parameters
  • data_dir (str or None) – name of data directory, defaults to None

  • update (bool) – whether to check on update and proceed to update the package data, defaults to False

  • verbose (bool or int) – whether to print relevant information in console as the function runs, defaults to True

Variables
  • Name (str) – name of the data

  • Key (str) – key of the dict-type data

  • HomeURL (str) – URL of the main homepage

  • SourceURL (str) – URL of the data web page

  • LUDKey (str) – key of the last updated date

  • LUD (str) – last updated date

  • Catalogue (dict) – catalogue of the data

  • DataDir (str) – path to the data directory

  • CurrentDataDir (str) – path to the current data directory

Example:

>>> from pyrcs.line_data import LineNames

>>> ln = LineNames()

>>> print(ln.Name)
Railway line names

>>> print(ln.SourceURL)
http://www.railwaycodes.org.uk/misc/line_names.shtm

Methods

collect_line_names([confirmation_required, …])

Collect data of railway line names from source web page.

fetch_line_names([update, pickle_it, …])

Fetch data of railway line names from local backup.