fusion_addin_framework.utils.get_json_from_file¶
- fusion_addin_framework.utils.get_json_from_file(path: Union[str, pathlib.Path], default_value: Optional[Union[Dict, List]] = None) → Union[Dict, List]¶
Gets the json decoded data from the file if the file exists and creates the file if its not exists. IF its not existing the default value is returned.
- Parameters
path (Union[str, Path]) – The file path of the json file.
default_value (Union[Dict, List], optional) – The value which gets inserted into the newly created file and is returned in case the file doesnt exist. Defaults to None.
- Returns
- The json decoded content of the file or the default value if the
file hasnt existed yet.
- Return type
Union[Dict, List]