MsgPack
MsgPack is a binary serialization format that is similar to JSON, but more efficient. It is a good choice for serializing data that will be sent over the network or stored in a file.
References
API Reference
Bases: kvdb.io.serializers.base.BinaryBaseSerializer
Source code in kvdb/io/serializers/_msgpack.py
adecode
async
adumps
async
aencode
async
aloads
async
compress_value
Compresses the value
Source code in kvdb/io/serializers/base.py
copy
copy(**kwargs) -> kvdb.io.serializers.base.BaseSerializer
Copies the serializer
Source code in kvdb/io/serializers/base.py
create_hash
decode
Decodes the value
Source code in kvdb/io/serializers/base.py
decode_value
decode_value(value: bytes, **kwargs) -> typing.Union[
kvdb.io.serializers.base.SchemaType,
typing.Dict,
typing.Any,
]
Decode the value with the Pickle Library
Source code in kvdb/io/serializers/_msgpack.py
decompress_value
Decompresses the value
Source code in kvdb/io/serializers/base.py
default_deserialization_hook
default_deserialization_hook(
code: int, data: typing.Union[str, bytes]
) -> kvdb.io.serializers.base.ObjectValue
Default Deserialization Hook
Source code in kvdb/io/serializers/_msgpack.py
default_serialization_hook
Default Serialization Hook
Source code in kvdb/io/serializers/_msgpack.py
deprecated_decompress_value
deprecated_decompress_value(
value: typing.Union[str, bytes], **kwargs
) -> typing.Optional[typing.Union[str, bytes]]
Attempts to decompress the value using the deprecated compressor
Source code in kvdb/io/serializers/base.py
dumps
Dumps the value
Source code in kvdb/io/serializers/base.py
encode
encode_value
encode_value(
value: typing.Union[
typing.Any, kvdb.io.serializers.base.SchemaType
],
**kwargs
) -> bytes
Encode the value with the Pickle Library
Source code in kvdb/io/serializers/_msgpack.py
fetch_object_classname
loads
Loads the value
Source code in kvdb/io/serializers/base.py
set_default_lib
classmethod
set_default_lib(
lib: typing.Union[
str,
kvdb.io.serializers._msgpack.MsgPackLibT,
kvdb.io.serializers.base.ModuleType,
]
) -> None
Sets the default MsgPack library