Viaducts.collect_codes_by_page

Viaducts.collect_codes_by_page(page_no, update=False, verbose=False)[source]

Collects data of railway viaducts for a specified page number from the source web page.

Parameters:
  • page_no (int | str) – The page number to collect data from; valid values include 1, 2, 3, 4, 5 and 6

  • update (bool) – Whether to check for updates to the package data; defaults to False.

  • verbose (bool | int) – Whether to print relevant information to the console; defaults to False.

Returns:

A dictionary containing the data of railway viaducts for the specified page_no and the date of when the data was last updated.

Return type:

dict

Examples:

>>> from pyrcs.other_assets import Viaducts  # from pyrcs import Viaducts
>>> vdct = Viaducts()
>>> page_1_codes = vdct.collect_codes_by_page(page_no=1)
>>> type(page_1_codes)
dict
>>> list(page_1_codes.keys())
['Page 1 (A-C)', 'Last updated date']
>>> page_1_dat = page_1_codes['Page 1 (A-C)']
>>> type(page_1_dat)
pandas.core.frame.DataFrame
>>> page_1_dat.head()
            Name  ... Spans
0       7 Arches  ...     7
1        36 Arch  ...    36
2        42 Arch  ...
3           A698  ...     5
4  Abattoir Road  ...     8
[5 rows x 7 columns]