ELRMileages

class elr_mileage.ELRMileages(data_dir=None, update=False)[source]

A class for collecting Engineer’s Line References (ELRs) codes.

Parameters
  • data_dir (str or 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.line_data import ELRMileages

>>> em = ELRMileages()

>>> print(em.Name)
ELRs and mileages

>>> print(em.SourceURL)
http://www.railwaycodes.org.uk/elrs/elr0.shtm

Methods

ELRMileages.cdd_em(*sub_dir[, mkdir])

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

ELRMileages.collect_elr_by_initial(initial)

Collect Engineer’s Line References (ELRs) for the given initial letter from source web page.

ELRMileages.collect_mileage_file(elr[, …])

Collect mileage file for the given ELR from source web page.

ELRMileages.fetch_elr([update, pickle_it, …])

Fetch ELRs and mileages from local backup.

ELRMileages.fetch_mileage_file(elr[, …])

Fetch mileage file for the given ELR from local backup.

ELRMileages.get_conn_mileages(start_elr, end_elr)

Get a connection point between two ELR-and-mileage pairs.

ELRMileages.parse_mileage_col(mileage)

Parse column of mileage data.

ELRMileages.parse_mileage_data(mileage_data)

Parse scraped data of mileage file.

ELRMileages.parse_multi_measures(mileage_data)

Process data of mileage file with multiple measures.

ELRMileages.parse_node_col(node)

Parse column of node data.

ELRMileages.search_conn(start_elr, start_em, …)

Search for connection between two ELR-and-mileage pairs.