robust_json
Provides a robust JSON encoder that can handle various types of objects.
Including dataclasses, paths, enums, namespaces, and functions.
Functions
Serialize object to JSON file using RobustJSONEncoder. |
|
Serialize object to JSON string using RobustJSONEncoder. |
|
Load JSON from file and return as dictionary. |
- json_dump(obj, path)
Serialize object to JSON file using RobustJSONEncoder.
- Parameters:
obj (Any)
path (Path | str)
- Return type:
None
- json_dumps(obj)
Serialize object to JSON string using RobustJSONEncoder.
- Parameters:
obj (Any)
- Return type:
str
- json_load(path)
Load JSON from file and return as dictionary.
- Parameters:
path (Path | str)
- Return type:
dict