Features.collect_telegraph_codes¶
-
Features.
collect_telegraph_codes
(confirmation_required=True, verbose=False)[source]¶ Collect telegraph code words from source web page.
- Parameters
confirmation_required (bool) – whether to prompt a message for confirmation to proceed, defaults to
True
verbose (bool or int) – whether to print relevant information in console as the function runs, defaults to
False
- Returns
data of telegraph code words, and date of when the data was last updated
- Return type
dict or None
Example:
>>> from pyrcs.other_assets import Features >>> features = Features() >>> tel_codes_dat = features.collect_telegraph_codes() To collect data of telegraphic codes? [No]|Yes: yes >>> type(tel_codes_dat) dict >>> list(tel_codes_dat.keys()) ['Telegraphic codes', 'Last updated date'] >>> tel_codes = tel_codes_dat['Telegraphic codes'] >>> type(tel_codes) dict >>> list(tel_codes.keys()) ['Official codes', 'Unofficial codes'] >>> print(tel_codes['Official codes'].head()) Code ... In use 0 ACACIA ... 'companies', 1939 1 ACK ... BR, 1980s 2 ADEX ... GWR, 1939 BR, 1980s 3 AJAX ... BR, 1980s 4 ALERT ... BR, 1980s [5 rows x 3 columns]