LocationIdentifiers

class loc_id.LocationIdentifiers(data_dir=None, update=False, verbose=True)

A class for collecting location identifiers (including other systems station).

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

  • update (bool) – whether to do an update check (for the package 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

  • OtherSystemsKey (str) – key of the dict-type data of other systems

  • OtherSystemsPickle (str) – name of the pickle file of other systems data

  • AddNotesKey (str) – key of the dict-type data of additional notes

  • MscENKey (str) – key of the dict-type data of multiple station codes explanatory note

  • MscENPickle (str) – name of the pickle file of multiple station codes explanatory note

Example:

>>> from pyrcs.line_data import LocationIdentifiers

>>> lid = LocationIdentifiers()

>>> print(lid.Name)
CRS, NLC, TIPLOC and STANOX codes

>>> print(lid.SourceURL)
http://www.railwaycodes.org.uk/crs/crs0.shtm

Methods

amendment_to_loc_names()

Create a replacement dictionary for location name amendments.

collect_explanatory_note([…])

Collect note about CRS code from source web page.

collect_loc_codes_by_initial(initial[, …])

Collect CRS, NLC, TIPLOC, STANME and STANOX codes for a given initial letter.

collect_other_systems_codes([…])

Collect data of other systems’ codes from source web page.

fetch_explanatory_note([update, pickle_it, …])

Fetch multiple station codes explanatory note from local backup.

fetch_location_codes([update, pickle_it, …])

Fetch CRS, NLC, TIPLOC, STANME and STANOX codes from local backup.

fetch_other_systems_codes([update, …])

Fetch data of other systems’ codes from local backup.

make_loc_id_dict(keys[, initials, …])

Make a dict/dataframe for location code data for the given keys.

parse_note_page(note_url[, parser, verbose])

Parse addition note page.