modelspec.utils

Functions

ascii_encode_dict(data)

build_xml_element(data[, parent])

This recursively builds an XML element structure from a dictionary or a list.

convert_xml_dict_values(value)

This recursively converts values to their actual types.

elementtree_element_to_dict(element)

This convert an ElementTree element to a dictionary.

evaluate(expr[, parameters, rng, ...])

Evaluate a general string like expression (e.g. "2 * weight") using a dict of parameters (e.g. {'weight':10}).

handle_xml_dict_id(dictionary)

load_bson(filename)

Load a generic BSON file

load_json(filename)

Load a generic JSON file

load_xml(filename)

Load a generic XML file.

load_yaml(filename)

Load a generic YAML file

locate_file(f, base_dir)

Utility method for finding full path to a filename as string

parse_list_like(list_str)

process_xml_namespace(xml_string)

save_to_json_file(info_dict, filename[, indent])

save_to_xml_file(info_dict, filename[, ...])

This saves a dictionary to an XML file.

save_to_yaml_file(info_dict, filename[, indent])