LOR.collect_keys_to_prefixes¶
- LOR.collect_keys_to_prefixes(confirmation_required=True, verbose=False, raise_error=False)[source]¶
Collects the keys to PRIDE/LOR code prefixes from the source web page.
- Parameters:
confirmation_required (bool) – Whether user confirmation is required; if
confirmation_required=True
(default), prompts the user for confirmation before proceeding with data collection.verbose (bool | int) – Whether to print relevant information to the console; defaults to
False
.raise_error (bool) – Whether to raise the provided exception; if
raise_error=False
(default), the error will be suppressed.
- Returns:
A dictionary containing code prefixes and the last updated date, or
None
if no data is available.- Return type:
dict | None
Examples:
>>> from pyrcs.line_data import LOR # from pyrcs import LOR >>> lor = LOR() >>> lor_page_urls = lor.collect_keys_to_prefixes() To collect data of URLs to LOR codes web pages ? [No]|Yes: yes Collecting the data ... Done. >>> lor_page_urls[0] 'http://www.railwaycodes.org.uk/pride/pridecy.shtm'