ELRMileages.collect_elr_by_initial

ELRMileages.collect_elr_by_initial(initial, update=False, verbose=False)

Collect Engineer’s Line References (ELRs) for a given initial letter from source web page.

Parameters
  • initial (str) – initial letter of an ELR, e.g. 'a', 'z'

  • 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

Returns

data of ELRs whose names start with the given initial letter and date of when the data was last updated

Return type

dict

Examples:

>>> from pyrcs.line_data import ELRMileages  # from pyrcs import ELRMileages

>>> em = ELRMileages()

>>> elrs_a_codes = em.collect_elr_by_initial(initial='a')
>>> type(elrs_a_codes)
dict
>>> list(elrs_a_codes.keys())
['A', 'Last updated date']

>>> elrs_a_codes_dat = elrs_a_codes['A']
>>> type(elrs_a_codes_dat)
pandas.core.frame.DataFrame
>>> elrs_a_codes_dat.head()
   ELR  ...         Notes
0  AAL  ...      Now NAJ3
1  AAM  ...  Formerly AML
2  AAV  ...
3  ABB  ...       Now AHB
4  ABB  ...
[5 rows x 5 columns]

>>> elrs_q_codes = em.collect_elr_by_initial(initial='Q')
>>> elrs_q_codes_dat = elrs_q_codes['Q']
>>> elrs_q_codes_dat.head()
    ELR  ...            Notes
0   QAB  ...  Duplicates ALB?
1   QBL  ...
2   QDS  ...
3   QLT  ...
4  QLT1  ...
[5 rows x 5 columns]