LOR¶
-
class
lor_code.
LOR
(data_dir=None, update=False, verbose=True)[source]¶ A class for collecting Line of Route (LOR/PRIDE) codes.
PRIDE: Possession Resource Information Database
LOR: Line Of Route
- 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 LOR data
PKey (str) – key of the dict-type prefixes
ELCKey (str) – key of the dict-type ELR/LOR converter 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 LOR >>> lor = LOR() >>> print(lor.Name) Possession Resource Information Database (PRIDE)/Line Of Route (LOR) codes >>> print(lor.SourceURL) http://www.railwaycodes.org.uk/pride/pride0.shtm
Methods
Collect ELR/LOR converter from source web page.
collect_lor_codes_by_prefix
(prefix[, …])Collect PRIDE/LOR codes by a given prefix.
fetch_elr_lor_converter
([update, pickle_it, …])Fetch ELR/LOR converter from local backup.
fetch_lor_codes
([update, pickle_it, …])Fetch PRIDE/LOR codes from local backup.
get_keys_to_prefixes
([prefixes_only, …])Get key to PRIDE/LOR code prefixes.
get_lor_page_urls
([update, verbose])Get URLs to PRIDE/LOR codes with different prefixes.