LocationIdentifiers.fetch_codes
- LocationIdentifiers.fetch_codes(update=False, dump_dir=None, verbose=False)
Fetch CRS, NLC, TIPLOC, STANME and STANOX codes and other systems’ station codes.
- Parameters
update (bool) – whether to do an update check (for the package data), defaults to
False
dump_dir (str or None) – pathname of a directory where the data file is dumped, defaults to
None
verbose (bool or int) – whether to print relevant information in console, defaults to
False
- Returns
data of location codes and date of when the data was last updated
- Return type
dict
Examples:
>>> from pyrcs.line_data import LocationIdentifiers >>> # from pyrcs import LocationIdentifiers >>> lid = LocationIdentifiers() >>> loc_dat = lid.fetch_codes() >>> type(loc_dat) dict >>> list(loc_dat.keys()) ['LocationID', 'Other systems', 'Additional notes', 'Last updated date'] >>> lid.KEY 'LocationID' >>> loc_codes = loc_dat['LocationID'] >>> type(loc_codes) pandas.core.frame.DataFrame >>> loc_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]