maltoolbox.file_utils module

Utily functions for file handling

maltoolbox.file_utils.load_dict_from_json_file(filename: str) dict[source]

Open yaml file and read as dict

maltoolbox.file_utils.load_dict_from_yaml_file(filename: str) dict[source]

Open json file and read as dict

maltoolbox.file_utils.save_dict_to_file(filename: str, dictionary: dict) None[source]

Save serialized object to json or yaml file depending on file extension.

Arguments: filename - the name of the output file dictionary - the dict to save to the file

maltoolbox.file_utils.save_dict_to_json_file(filename: str, serialized_object: dict) None[source]

Save serialized object to a json file.

Arguments: filename - the name of the output file data - dict to output as json

maltoolbox.file_utils.save_dict_to_yaml_file(filename: str, serialized_object: dict) None[source]

Save serialized object to a yaml file.

Arguments: filename - the name of the output file data - dict to output as yaml