mdf_reader.data_models.schemas
¶
This module has functions to manage data model schema files and objects according to the requirements of the data reader tool
Module Contents¶
Functions¶
|
Reads a data model schema file to a dictionary and |
|
Creates a simple attribute dictionary for the elements |
Lists the name of the available schema file templates |
|
|
Copies a schema file template to an output |
Attributes¶
-
read_schema
(schema_name=None, ext_schema_path=None)[source]¶ Reads a data model schema file to a dictionary and completes it by adding explicitly information the reader tool needs
- Keyword Arguments
schema_name (str, optional) – The name of data model to read. This is for data models included in the tool
ext_schema_path (str, optional) – The path to the external data model schema file
Either schema_name or ext_schema_path must be provided.
- Returns
Data model schema
- Return type
dict
-
df_schema
(df_columns, schema)[source]¶ Creates a simple attribute dictionary for the elements in a dataframe from its data model schema
- Parameters
df_columns (list) – The columns in the data frame (data elements from the data model)
schema (dict) – The data model schema
- Returns
Data elements attributes
- Return type
dict
-
templates
()[source]¶ Lists the name of the available schema file templates
- Returns
Schema file templates alias
- Return type
list
-
copy_template
(schema, out_dir=None, out_path=None)[source]¶ Copies a schema file template to an output file or path
- Parameters
schema (str) – Schema template name to copy
- Keyword Arguments
out_dir (dict, opt) – Directory to copy schema file template to
out_path (dict, opt) – Full filename to copy schema file template to
out_dir or out_path must be provided (Either) –