Viaducts.collect_viaduct_codes_by_page

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

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

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

  • update (bool) – whether to check on update and proceed to update the package data, defaults to False

  • verbose (bool) – whether to print relevant information in console as the function runs, defaults to False

Returns

railway viaducts data of the given page_no and date of when the data was last updated

Return type

dict

Example:

>>> from pyrcs.other_assets import Viaducts

>>> vdct = Viaducts()

>>> # vd1 = vdct.collect_viaduct_codes_by_page(1, update=True, verbose=True)
>>> vd1 = vdct.collect_viaduct_codes_by_page(page_no=1)

>>> type(vd1)
dict
>>> list(vd1.keys())
['Page 1 (A-C)', 'Last updated date']

>>> viaducts_1 = vd1['Page 1 (A-C)']
>>> print(viaducts_1.head())
       Name  ... Spans
0  7 Arches  ...     7
1   36 Arch  ...    36
2   42 Arch  ...
3     A6120  ...
4      A698  ...
[5 rows x 7 columns]