LineData

class pyrcs.collector.LineData(update=False, verbose=True)[source]

A class representation of all modules of the subpackage pyrcs.line_data for collecting line data.

Parameters
  • update (bool) – whether to check on update and proceed to update the package data, defaults to False

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

Examples:

>>> from pyrcs import LineData

>>> ld = LineData()

>>> # To get data of location codes
>>> location_codes_data = ld.LocationIdentifiers.fetch_location_codes()

>>> type(location_codes_data)
<class 'dict'>
>>> print(list(location_codes_data.keys()))
['Location codes', 'Other systems', 'Additional notes', 'Last updated date']
>>> location_codes_dat = location_codes_data['Location codes']
>>> print(location_codes_dat.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]

>>> # To get data of line names
>>> line_names_data = ld.LineNames.fetch_line_names()

>>> type(line_names_data)
<class 'dict'>
>>> print(list(line_names_data.keys()))
['Line names', 'Last updated date']
>>> line_names_dat = line_names_data['Line names']
>>> print(line_names_dat.head())
             Line name  ... Route_note
0           Abbey Line  ...       None
1        Airedale Line  ...       None
2          Argyle Line  ...       None
3     Arun Valley Line  ...       None
4  Atlantic Coast Line  ...       None

[5 rows x 3 columns]

Methods

update([confirmation_required, verbose, …])

Update local backup of the line data.