save_json#

save_json(json_dict: dict, output_json: Union[str, CloudPath, Path], **kwargs) None[source]#

Save a JSON file, with datetime, numpy types and Enum management.

>>> output_json = 'D:/path/to/json.json'
>>> json_dict = {"A": np.int64(1), "B": datetime.today(), "C": SomeEnum.some_name}
>>> save_json(output_json, json_dict)
Parameters:
  • json_dict (dict) – Json dictionary

  • output_json (AnyPathStrType) – Output file

  • **kwargs – Other arguments