Tunnels

class tunnel.Tunnels(data_dir=None, update=False, verbose=True)[source]

A class for collecting railway tunnel lengths.

Parameters
  • data_dir (str, None) – name of data directory, defaults to None

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

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

Example:

>>> from pyrcs.other_assets import Tunnels

>>> tunnels = Tunnels()

>>> print(tunnels.Name)
Railway tunnel lengths

>>> print(tunnels.SourceURL)
http://www.railwaycodes.org.uk/tunnels/tunnels0.shtm

Methods

collect_lengths_by_page(page_no[, update, …])

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

fetch_tunnel_lengths([update, pickle_it, …])

Fetch data of railway tunnel lengths from local backup.

parse_length(x)

Parse data in 'Length' column, i.e. convert miles/yards to metres.