Depots.collect_1950_system_codes

Depots.collect_1950_system_codes(confirmation_required=True, verbose=False, raise_error=False)[source]

Collect 1950 system (pre-TOPS) 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 1950 system (pre-TOPS) codes and the date they were last updated, or None if no data is collected.

Return type:

dict | None

Examples:

>>> from pyrcs.other_assets import Depots  # from pyrcs import Depots

>>> depots = Depots()

>>> s1950_codes = depots.collect_1950_system_codes(verbose=True)
Proceed with collecting data of "1950 system (pre-TOPS)"?
 [No]|Yes: yes
Collecting the data ... Done.

>>> type(s1950_codes)
dict
>>> list(s1950_codes)
['1950 system (pre-TOPS)', 'Last updated date']

>>> s1950_codes_dat = s1950_codes['1950 system (pre-TOPS)']
>>> type(s1950_codes_dat)
pandas.DataFrame
>>> s1950_codes_dat.shape
(622, 3)
>>> s1950_codes_dat.head()
  Code        Depot name                                              Notes
0   1A         Willesden              From 1950.  Became WN from 6 May 1973
1   1B            Camden                      From 1950.  To 3 January 1966
2   1C           Watford              From 1950.  Became WJ from 6 May 1973
3   1D  Devons Road, Bow  Previously 13B to 9 June 1950.  Became 1J from...
4   1D        Marylebone  Previously 14F to 31 August 1963.  Became ME f...