Tunnels.collect_lengths_by_page

Tunnels.collect_lengths_by_page(page_no, update=False, verbose=False)[source]

Collect data of railway tunnel lengths for a page number from source web page.

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

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

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

Returns

tunnel lengths data of the given page_no and date of when the data was last updated

Return type

dict

Examples:

>>> from pyrcs.other_assets import Tunnels

>>> tunl = Tunnels()

>>> tunl_len_1 = tunl.collect_lengths_by_page(page_no=1)
>>> type(tunl_len_1)
dict
>>> list(tunl_len_1.keys())
['Page 1 (A-F)', 'Last updated date']

>>> tunl_len_4 = tunl.collect_lengths_by_page(page_no=4)
>>> type(tunl_len_4)
dict
>>> list(tunl_len_4.keys())
['Page 4 (others)', 'Last updated date']