serialization#
Functions
|
|
|
Customized JSON serializer. |
|
Deserialize the JSON string back to an object. |
|
Serialize the object to a json string. |
|
Convert the object to a dictionary. |
Classes
|
- class ObjectTypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
Enum
- CLASS = 1#
- INSTANCE = 2#
- TYPE = 3#
- check_object(obj) ObjectTypes [source]#
- default(o: Any) Dict[str, Any] | str [source]#
Customized JSON serializer.
Support internal dataclasses and components instance serialization by calling to_dict() method.
Support internal dataclasses class serialization by calling to_dict_class() method.
Any external instance if it has to_dict() method, it will be serialized.
All other objects will be serialized as {“type”: type(o).__name__, “data”: str(o)}