json_interface#
- confs.json_interface.read_json(json_file)[source]#
DESCRIPTION:
This function ingests a JavaScript Object Notation (e.g., JSON) formatted file and returns a Python dictionary containing all attributes of the file.
- Parameters:
- json_file:
str A Python string containing the full-path to the JSON file to be parsed.
- json_file:
- Returns:
- json_dict:
Dict A Python dictionary containing all attributes contained within the ingested JSON file.
- json_dict:
- Raises:
- JSONInterfaceError:
raised is an exception is encountered while reading from the JSON-formatted file specified upon entry.
- Return type:
Dict
- confs.json_interface.write_json(json_file, in_dict, indent=4)[source]#
DESCRIPTION:
This function writes a JavaScript Object Notation (e.g., JSON) formatted file using the specified Python dictionary.
- Parameters:
- json_file:
str A Python string containing the full-path to the JSON file to be written.
- in_dict:
Dict A Python dictionary containing the attributes to be written to the JSON file.
- json_file:
- Keywords:
- indent:
int, optional A Python integer defining the indentation level for the attributes within the JSON-formatted file.
- indent:
- Raises:
- JSONInterfaceError:
raised is an exception is encountered while writing to the JSON-formatted file specified upon entry.
- Return type:
None