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

>>> tunnels = Tunnels()

>>> tunnel_len_1 = tunnels.collect_lengths_by_page(page_no=1)
>>> type(tunnel_len_1)
<class 'dict'>
>>> print(list(tunnel_len_1.keys()))
['Page 1 (A-F)', 'Last updated date']

>>> tunnel_len_4 = tunnels.collect_lengths_by_page(page_no=4)
>>> type(tunnel_len_4)
<class 'dict'>
>>> print(list(tunnel_len_4.keys()))
['Page 4 (others)', 'Last updated date']