ELRMileages¶
-
class
elr_mileage.
ELRMileages
(data_dir=None, update=False, verbose=True)[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
verbose (bool or int) – whether to print relevant information in console as the function runs, defaults to
True
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
collect_elr_by_initial
(initial[, update, …])Collect Engineer’s Line References (ELRs) for the given initial letter from source web page.
collect_mileage_file
(elr[, parsed, …])Collect mileage file for the given ELR from source web page.
fetch_elr
([update, pickle_it, data_dir, verbose])Fetch ELRs and mileages from local backup.
fetch_mileage_file
(elr[, update, pickle_it, …])Fetch mileage file for the given ELR from local backup.
get_conn_mileages
(start_elr, end_elr[, …])Get a connection point between two ELR-and-mileage pairs.
parse_mileage_col
(mileage)Parse column of mileage data.
parse_mileage_data
(mileage_data)Parse scraped data of mileage file.
parse_multi_measures
(mileage_data)Process data of mileage file with multiple measures.
parse_node_col
(node)Parse column of node data.
search_conn
(start_elr, start_em, end_elr, end_em)Search for connection between two ELR-and-mileage pairs.