LineNames.collect_line_names

LineNames.collect_line_names(confirmation_required=True, verbose=False)[source]

Collect data of railway line names from source web page.

Parameters
  • confirmation_required (bool) – whether to require users to confirm and proceed, defaults to True

  • verbose (bool) – whether to print relevant information in console as the function runs, defaults to False

Returns

railway line names and routes data and date of when the data was last updated

Return type

dict or None

Example:

>>> from pyrcs.line_data import LineNames

>>> ln = LineNames()

>>> line_names_dat = ln.collect_line_names(confirmation_required=False)

>>> type(line_names_dat)
<class 'dict'>
>>> print(list(line_names_dat.keys()))
['Line names', 'Last updated date']