ctyparser¶
A CTY.DAT parser for modern amateur radio programs.
License¶
Copyright 2019-2022 classabbyamp, 0x5c
Released under the MIT License. See LICENSE for the full license text.
API¶
-
class
ctyparser.BigCty(file_path: Union[str, os.PathLike, None] = None)¶ Class representing a BigCTY dataset. Can be initialised with data by passing the path to a valid
cty.jsonfile to the constructor.Parameters: file_path (str or os.PathLike, optional) – Location of the cty.jsonfile to load.Variables: version (str) – the datestamp of the data, YYYYMMDDformat.-
dump(cty_file: Union[str, os.PathLike]) → None¶ Dumps the data of the instance to a
cty.jsonfile.Parameters: cty_file (str or os.PathLike) – Path to the file to dump to. Returns: None
-
formatted_version¶ Formatted representation of the version/date of the current BigCTY data.
Getter: Returns version in YYYY-MM-DDformat, or0000-00-00(if invalid date)Type: str
-
import_dat(dat_file: Union[str, os.PathLike]) → None¶ Imports CTY data from a
CTY.DATfile.Parameters: dat_file (str or os.PathLike) – Path to the file to import. Returns: None
-
load(cty_file: Union[str, os.PathLike]) → None¶ Loads a
cty.jsonfile into the instance.Parameters: cty_file (str or os.PathLike) – Path to the file to load. Returns: None
-
update() → bool¶ Upates the instance’s data from the feed.
Raises: Exception – If there is no date in the feed. Returns: Trueif an update was done, otherwiseFalse.Return type: bool
-
version¶ The version/date of the current BigCTY data.
Getter: Returns version in YYYYMMDDformatType: str
-
CLI Usage¶
Note
CLI is a work in progress!
Currently, only updating/creating a file named cty.json in the current working directory is supported:
$ python3 -m ctyparser