mdf_reader.data_models.code_tables

This module has functions to manage data model code table files and objects according to the requirements of the data reader tool

Module Contents

Functions

read_table(table_path)

Reads a data model code table file to a dictionary.

templates()

Lists the name of the available code table templates

copy_template(table, out_dir=None, out_path=None)

Copies a code table template to an output

expand_integer_range_key(d)

eval_dict_items(item)

table_keys(table)

get_nested(table, *args)

table_value_from_keys(table, df)

Attributes

toolPath

table_lib

templates_path

toolPath[source]
table_lib[source]
templates_path[source]
read_table(table_path)[source]

Reads a data model code table file to a dictionary. It completes the code table to the full complexity the data reader expects, by appending information on secondary keys and expanding range keys.

Parameters

table_path (str) – The file path of the code table.

Returns

Code table

Return type

dict

templates()[source]

Lists the name of the available code table templates

Returns

Code table template aliases

Return type

list

copy_template(table, out_dir=None, out_path=None)[source]

Copies a code table template to an output file or path

Parameters

table (str) – Code table template name to copy

Keyword Arguments
  • out_dir (dict, opt) – Directory to copy code table file template to

  • out_path (dict, opt) – Full filename to copy code table file template to

  • out_dir or out_path must be provided (Either) –

expand_integer_range_key(d)[source]
eval_dict_items(item)[source]
table_keys(table)[source]
get_nested(table, *args)[source]
table_value_from_keys(table, df)[source]