ELRMileages.collect_elr_by_initial

ELRMileages.collect_elr_by_initial(initial, update=False, verbose=False)[source]

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

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

  • 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 False

Returns

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

Return type

dict

Example:

>>> from pyrcs.line_data import ELRMileages

>>> em = ELRMileages()

>>> # elrs_a = em.collect_elr_by_initial(initial='a', update=True, verbose=True)
>>> elrs_a = em.collect_elr_by_initial(initial='a')

>>> type(elrs_a)
<class 'dict'>
>>> print(list(elrs_a.keys()))
['A', 'Last updated date']

>>> print(elrs_a['A'].head())
   ELR  ...         Notes
0  AAL  ...      Now NAJ3
1  AAM  ...  Formerly AML
2  AAV  ...
3  ABB  ...       Now AHB
4  ABB  ...
[5 rows x 5 columns]