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

Collect four-digit pre-TOPS codes from source web page.

  • confirmation_required (bool) – whether to confirm before proceeding, defaults to True

  • verbose (bool or int) – whether to print relevant information in console, defaults to False


data of four-digit pre-TOPS codes and date of when the data was last updated

Return type:

dict or None


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

>>> depots = Depots()

>>> fdpt_codes = depots.collect_pre_tops_codes()
To collect data of four digit pre-TOPS codes
? [No]|Yes: yes
>>> type(fdpt_codes)
>>> list(fdpt_codes.keys())
['Four digit pre-TOPS codes', 'Last updated date']

>>> depots.KEY_TO_PRE_TOPS
'Four digit pre-TOPS codes'

>>> fdpt_codes_dat = fdpt_codes[depots.KEY_TO_PRE_TOPS]
>>> type(fdpt_codes_dat)
>>> fdpt_codes_dat.head()
   Code             Depot name          Region  Main Works site
0  2000             Accrington  London Midland            False
1  2001   Derby Litchurch Lane  London Midland             True
2  2003              Blackburn  London Midland            False
3  2004  Bolton Trinity Street  London Midland            False
4  2006                Burnley  London Midland            False