LocationIdentifiers.collect_notes¶
- LocationIdentifiers.collect_notes(confirmation_required=True, verbose=False, raise_error=False)[source]¶
Collects the explanatory note related to multiple station codes (CRS codes) from the source web page.
- Parameters:
confirmation_required (bool) – Whether user confirmation is required; if
confirmation_required=True
(default), prompts the user for confirmation before proceeding with data collection.verbose (bool | int) – Whether to print relevant information to the console; defaults to
False
.raise_error (bool) – Whether to raise the provided exception; if
raise_error=False
(default), the error will be suppressed.
- Returns:
A dictionary containing the data of the multiple station codes explanatory note, or
None
if the note is not found or the collection is not performed.- Return type:
dict | None
Examples:
>>> from pyrcs.line_data import LocationIdentifiers >>> # from pyrcs import LocationIdentifiers >>> lid = LocationIdentifiers() >>> notes = lid.collect_notes() To collect data of multiple station codes explanatory note ? [No]|Yes: yes >>> type(notes) dict >>> list(notes.keys()) ['Notes', 'Last updated date'] >>> lid.KEY_TO_NOTES 'Notes' >>> notes_ = notes[lid.KEY_TO_NOTES] >>> type(notes_) dict >>> notes_[lid.KEY_TO_MSCEN][2].head() location_name CRS1 CRS2 CRS3 0 Bletchley BLY BLU 1 Ebbsfleet International EBD EBF 2 Glasgow Central GLC GCL 3 Glasgow Queen Street GLQ GQL 4 Heworth HEW HEZ