Skip to content

aea.helpers.serializers

This module contains Serializers that can be used for custom types.

DictProtobufStructSerializer Objects

class DictProtobufStructSerializer()

Serialize python dictionaries of type DictType = Dict[str, ValueType] recursively conserving their dynamic type, using google.protobuf.Struct

ValueType = PrimitiveType | DictType | List[ValueType]] PrimitiveType = bool | int | float | str | bytes

encode

 | @classmethod
 | encode(cls, dictionary: Dict[str, Any]) -> bytes

Serialize compatible dictionary to bytes

decode

 | @classmethod
 | decode(cls, buffer: bytes) -> Dict[str, Any]

Deserialize a compatible dictionary