cdm_reader_mapper.mdf_reader.codes package¶
Common Data Model (CDM) code tables.
Subpackages¶
Submodules¶
cdm_reader_mapper.mdf_reader.codes.codes module¶
Manage data model code table files.
Functions to manage data model code table files and objects according to the requirements of the data reader tool.
- cdm_reader_mapper.mdf_reader.codes.codes.read_table(code_table_name, imodel=None, ext_table_path=None)[source]¶
Load a data model code table into a Python dictionary.
The code table may define secondary keys, range expansions, or other structures required by the data reader. This function resolves the file location either from an external path or an internal data model.
- Parameters:
code_table_name (
str) – The name of the code table (without file extension), e.g., “ICOADS.C0.IM”.imodel (
str, optional) – Internal data model name, e.g., “icoads_r300_d704”. Required if ext_table_path is not provided.ext_table_path (
str, optional) – External path containing the code table file. If set, this path takes precedence over imodel.
- Return type:
- Returns:
Dict– The fully combined code table dictionary.- Raises:
FileNotFoundError – If the specified table file cannot be found.
ValueError – If neither imodel nor ext_table_path is provided.