LocationIdentifiers.collect_loc_codes_by_initial¶
-
LocationIdentifiers.
collect_loc_codes_by_initial
(initial, update=False, verbose=False)¶ Collect CRS, NLC, TIPLOC, STANME and STANOX codes for a given
initial
letter.- Parameters
initial (str) – initial letter of station/junction name or certain word for specifying URL
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
False
- Returns
data of locations beginning with
initial
and date of when the data was last updated- Return type
dict
Example:
>>> from pyrcs.line_data import LocationIdentifiers >>> lid = LocationIdentifiers() >>> # loc_a = lid.collect_loc_codes_by_initial('a', update=True, verbose=True) >>> loc_a = lid.collect_loc_codes_by_initial(initial='a') >>> type(loc_a) dict >>> list(loc_a.keys()) ['A', 'Additional notes', 'Last updated date'] >>> loc_a_codes = loc_a['A'] >>> type(loc_a_codes) pandas.core.frame.DataFrame >>> loc_a_codes.head() Location CRS ... STANME_Note STANOX_Note 0 Aachen ... 1 Abbeyhill Junction ... 2 Abbeyhill Signal E811 ... 3 Abbeyhill Turnback Sidings ... 4 Abbey Level Crossing (Staffordshire) ... [5 rows x 12 columns]