Viaducts.collect_codes_by_page

Viaducts.collect_codes_by_page(page_no, update=False, verbose=False)

Collect data of railway viaducts for a given page number from source web page.

Parameters
  • page_no (int or str) – page number; valid values include 1, 2, 3, 4, 5, and 6

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

Returns

data of railway viaducts on page page_no and 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]