Depots

class depot.Depots(data_dir=None, update=False, verbose=True)

A class for collecting depot codes.

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

  • update (bool) – whether to do an update check (for the catagloue data), defaults to False

  • verbose (bool or int) – whether to print relevant information in console, 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

  • TCTKey (str) – key of the dict-type data of two character TOPS codes

  • TCTPickle (str) – name of the pickle file of two character TOPS codes

  • FDPTKey (str) – key of the dict-type data of four digit pre-TOPS codes

  • FDPTPickle (str) – name of the pickle file of four digit pre-TOPS codes

  • S1950Key (str) – key of the dict-type data of 1950 system (pre-TOPS) codes

  • S1950Pickle (str) – name of the pickle file of 1950 system (pre-TOPS) codes

  • GWRKey (str) – key of the dict-type data of GWR codes

  • GWRPickle (str) – name of the pickle file of GWR codes

Example:

>>> from pyrcs.other_assets import Depots

>>> depots = Depots()

>>> print(depots.Name)
Depot codes

>>> print(depots.SourceURL)
http://www.railwaycodes.org.uk/depots/depots0.shtm

Methods

collect_1950_system_codes([…])

Collect 1950 system (pre-TOPS) codes from source web page.

collect_four_digit_pre_tops_codes([…])

Collect four-digit pre-TOPS codes from source web page.

collect_gwr_codes([confirmation_required, …])

Collect Great Western Railway (GWR) depot codes from source web page.

collect_two_char_tops_codes([…])

Collect two-character TOPS codes from source web page.

fetch_1950_system_codes([update, pickle_it, …])

Fetch 1950 system (pre-TOPS) codes from local backup.

fetch_depot_codes([update, pickle_it, …])

Fetch depots codes from local backup.

fetch_four_digit_pre_tops_codes([update, …])

Fetch four-digit pre-TOPS codes from local backup.

fetch_gwr_codes([update, pickle_it, …])

Fetch Great Western Railway (GWR) depot codes from local backup.

fetch_two_char_tops_codes([update, …])

Fetch two-character TOPS codes from local backup.