Tunnels

class tunnel.Tunnels(data_dir=None, update=False)[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

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

Tunnels.cdd_tunnels(*sub_dir, **kwargs)

Change directory to package data directory and sub-directories (and/or a file).

Tunnels.collect_tunnel_lengths_by_page(page_no)

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

Tunnels.fetch_tunnel_lengths([update, …])

Fetch data of railway tunnel lengths from local backup.

Tunnels.parse_length(x)

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