LocationIdentifiers

class loc_id.LocationIdentifiers(data_dir=None, update=False)[source]

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 check on update and proceed to update the package data, defaults to False

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

LocationIdentifiers.amendment_to_loc_names()

Create a replacement dictionary for location name amendments.

LocationIdentifiers.cdd_lc(*sub_dir, **kwargs)

Change directory to package data directory and sub-directories (and/or a file).

LocationIdentifiers.collect_explanatory_note([…])

Collect note about CRS code from source web page.

LocationIdentifiers.collect_loc_codes_by_initial(initial)

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

LocationIdentifiers.collect_other_systems_codes([…])

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

LocationIdentifiers.fetch_explanatory_note([…])

Fetch multiple station codes explanatory note from local backup.

LocationIdentifiers.fetch_location_codes([…])

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

LocationIdentifiers.fetch_other_systems_codes([…])

Fetch data of other systems’ codes from local backup.

LocationIdentifiers.make_loc_id_dict(keys[, …])

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

LocationIdentifiers.parse_note_page(note_url)

Parse addition note page.