compressed#

Auto-compress and decompress data in DynamoDB.

class pynamodb_mate.attributes.compressed.CompressedAttribute(hash_key: bool = False, range_key: bool = False, null: Optional[bool] = None, default: Optional[Union[_T, Callable[[...], _T]]] = None, default_for_new: Optional[Union[Any, Callable[[...], _T]]] = None, attr_name: Optional[str] = None)[source]#

CompressedAttribute will serialize the original data to binary format, and compress it before sending to DynamoDB.

user_serializer(value: Any) bytes[source]#

Implement this method to define how you want to convert your data to binary.

user_deserializer(value: bytes) Any[source]#

Implement this method to define how you want to recover your data from binary.

serialize(value: Any) bytes[source]#

Returns a base64 encoded binary string

deserialize(value: bytes) Any[source]#

Returns a decoded byte string from a base64 encoded value

class pynamodb_mate.attributes.compressed.CompressedBinaryAttribute(hash_key: bool = False, range_key: bool = False, null: Optional[bool] = None, default: Optional[Union[_T, Callable[[...], _T]]] = None, default_for_new: Optional[Union[Any, Callable[[...], _T]]] = None, attr_name: Optional[str] = None)[source]#

A compressed binary Attribute.

user_serializer(value: Any) bytes[source]#

Implement this method to define how you want to convert your data to binary.

user_deserializer(value: bytes) Any[source]#

Implement this method to define how you want to recover your data from binary.

class pynamodb_mate.attributes.compressed.CompressedUnicodeAttribute(hash_key: bool = False, range_key: bool = False, null: Optional[bool] = None, default: Optional[Union[_T, Callable[[...], _T]]] = None, default_for_new: Optional[Union[Any, Callable[[...], _T]]] = None, attr_name: Optional[str] = None)[source]#

A compressed unicode Attribute.

user_serializer(value: Any) bytes[source]#

Implement this method to define how you want to convert your data to binary.

user_deserializer(value: bytes) Any[source]#

Implement this method to define how you want to recover your data from binary.

class pynamodb_mate.attributes.compressed.CompressedJSONDictAttribute(hash_key: bool = False, range_key: bool = False, null: Optional[bool] = None, default: Optional[Union[_T, Callable[[...], _T]]] = None, default_for_new: Optional[Union[Any, Callable[[...], _T]]] = None, attr_name: Optional[str] = None)[source]#

A compressed JSON dict Attribute.

user_serializer(value: dict) bytes[source]#

Implement this method to define how you want to convert your data to binary.

user_deserializer(value: bytes) dict[source]#

Implement this method to define how you want to recover your data from binary.