LineData

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

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

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

>>> location_codes_dat = location_codes_data[ld.LocationIdentifiers.Key]

>>> type(location_codes_dat)
pandas.core.frame.DataFrame
>>> 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)
dict
>>> list(line_names_data.keys())
['Line names', 'Last updated date']

>>> line_names_dat = line_names_data[ld.LineNames.Key]

>>> type(line_names_dat)
pandas.core.frame.DataFrame
>>> 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.