cdm_reader_mapper.mdf_reader.schemas package¶
Common Data Model (CDM) schema tables.
Subpackages¶
Submodules¶
cdm_reader_mapper.mdf_reader.schemas.schemas module¶
Manage data model schema files.
Functions to manage data model schema files and objects according to the requirements of the data reader tool.
- class cdm_reader_mapper.mdf_reader.schemas.schemas.SchemaDict[source]¶
Bases:
TypedDictComplete schema definition for a report.
- Variables:
header (
SchemaHeaderDict, optional) – Configuration for the report header.sections (
dict[str,SectionDict], optional) – Mapping of section names to section schemas.elements (
dict, optional) – Mapping of element names to their attributes.name (
list[Path], optional) – List of Path objects representing schema files or sources.imodel (
str | None, optional) – Name of the internal data model, if applicable.
- header: SchemaHeaderDict¶
- sections: dict[str, SectionDict]¶
- class cdm_reader_mapper.mdf_reader.schemas.schemas.SchemaHeaderDict[source]¶
Bases:
TypedDictSchema definition for the report header.
- Variables:
parsing_order (
list[dict], optional) – List of dictionaries defining the order in which header fields are parsed.delimiter (
str, optional) – Delimiter used to separate fields in the header.field_layout (
str, optional) – Layout or format of the fields (e.g., fixed width, CSV).format (
str, optional) – General format type of the header.encoding (
str, optional) – Text encoding for the header, e.g., ‘utf-8’.multiple_reports_per_line (
bool, optional) – Whether multiple reports may appear on a single line.
- class cdm_reader_mapper.mdf_reader.schemas.schemas.SectionDict[source]¶
Bases:
TypedDictSchema definition for a single section within a report.
- Variables:
- cdm_reader_mapper.mdf_reader.schemas.schemas.read_schema(imodel=None, ext_schema_path=None, ext_schema_file=None)[source]¶
Load and normalize a data model schema.
Reads a data model schema file into a dictionary and normalizes it by adding the information required by the parser.
- Parameters:
imodel (
str, optional) – Name of internally available input data model, e.g. icoads_r300_d704.ext_schema_path (
strorPath, optional) – The path to the external input data model schema file. The schema file must have the same name as the directory. One of imodel and ext_schema_path or ext_schema_file must be set.ext_schema_file (
strorPath, optional) – The external input data model schema file. One of imodel and ext_schema_path or ext_schema_file must be set.
- Return type:
- Returns:
SchemaDict– Data model schema.