LOR.get_keys_to_prefixes(prefixes_only=True, update=False, verbose=False)[source]

Get the keys to PRIDE/LOR code prefixes.

  • prefixes_only (bool) – whether to get only prefixes, defaults to True

  • 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


keys to LOR code prefixes

Return type:

list or dict or None


>>> from pyrcs.line_data import LOR  # from pyrcs import LOR

>>> lor = LOR()

>>> keys_to_pfx = lor.get_keys_to_prefixes()
>>> keys_to_pfx
['CY', 'EA', 'GW', 'LN', 'MD', 'NW', 'NZ', 'SC', 'SO', 'SW', 'XR']

>>> keys_to_pfx = lor.get_keys_to_prefixes(prefixes_only=False)
>>> type(keys_to_pfx)
>>> list(keys_to_pfx.keys())
['Key to prefixes', 'Last updated date']

>>> keys_to_pfx_codes = keys_to_pfx['Key to prefixes']
>>> type(keys_to_pfx_codes)
>>> keys_to_pfx_codes.head()
  Prefixes                                    Name
0       CY                                   Wales
1       EA         South Eastern: East Anglia area
2       GW  Great Western (later known as Western)
3       LN                  London & North Eastern
4       MD       North West: former Midlands lines