ELRMileages.collect_elr_by_initial¶
- ELRMileages.collect_elr_by_initial(initial, update=False, verbose=False)[source]¶
Collects Engineer’s Line References (ELRs) that begin with a specified initial letter from the source web page.
- Parameters:
initial (str) – The initial letter (e.g.
'a'
,'z'
) of an ELR.update (bool) – Whether to check for updates to the package data; defaults to
False
.verbose (bool | int) – Whether to print relevant information to the console; defaults to
True
.
- Returns:
A dictionary containing ELR data whose names start with the given initial letter, along with the date of the last update.
- 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]