Depots.fetch_pre_tops_codes(update=False, dump_dir=None, verbose=False)[source]

Fetch data of four-digit pre-TOPS codes.

  • update (bool) – whether to do an update check (for the package data), defaults to False

  • dump_dir (str or None) – pathname of a directory where the data file is dumped, defaults to None

  • 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:



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

>>> depots = Depots()

>>> fdpt_codes = depots.fetch_pre_tops_codes()
>>> 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