ELRMileages.collect_elr_by_initial

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

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 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 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('a', update=True, verbose=True)
>>> elrs_a = em.collect_elr_by_initial(initial='a')

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

>>> elrs_a_dat = elrs_a['A']

>>> type(elrs_a_dat)
pandas.core.frame.DataFrame
>>> elrs_a_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]