LOR
- class pyrcs.line_data.lor_code.LOR(data_dir=None, update=False, verbose=True)
A class for collecting data of Line of Route (LOR/PRIDE).
Note
‘LOR’ and ‘PRIDE’ stands for ‘Line Of Route’ and ‘Possession Resource Information Database’, respectively.
- 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
catalogue (dict) – catalogue of the data
last_updated_date (str) – last updated date
data_dir (str) – path to the data directory
current_data_dir (str) – path to the current data directory
valid_prefixes (list) – valid prefixes
Examples:
>>> from pyrcs.line_data import LOR # from pyrcs import LOR >>> lor = LOR() >>> lor.NAME 'Possession Resource Information Database (PRIDE)/Line Of Route (LOR) codes' >>> lor.URL 'http://www.railwaycodes.org.uk/pride/pride0.shtm'
Attributes
Key of the dict-type data
Key of the dict-type data of ELR/LOR converter
Key of the dict-type data of prefixes
Key of the data of the last updated date
Name of the data
Short name of the data
URL of the main web page of the data
Methods
collect_codes_by_prefix
(prefix[, update, ...])Collect PRIDE/LOR codes by a given prefix.
collect_elr_lor_converter
([...])Collect ELR/LOR converter from source web page.
fetch_codes
([update, dump_dir, verbose])Fetch data of PRIDE/LOR codes.
fetch_elr_lor_converter
([update, dump_dir, ...])Fetch data of ELR/LOR converter.
get_keys_to_prefixes
([prefixes_only, ...])Get the keys to PRIDE/LOR code prefixes.
get_page_urls
([update, verbose])Get URLs to PRIDE/LOR codes with different prefixes.