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
METHOD | DESCRIPTION |
---|---|
adecode |
Decodes the value asynchronously |
adumps |
Dumps the value asynchronously |
aencode |
Encodes the value asynchronously |
aloads |
Loads the value asynchronously |
compress_value |
Compresses the value |
copy |
Copies the serializer |
create_hash |
Creates a hash for the object |
decode |
Decodes the value |
decode_value |
Decode the value with the Pickle Library |
decompress_value |
Decompresses the value |
default_deserialization_hook |
Default Deserialization Hook |
default_serialization_hook |
Default Serialization Hook |
deprecated_decompress_value |
Attempts to decompress the value using the deprecated compressor |
dumps |
Dumps the value |
encode |
Encodes the value |
encode_value |
Encode the value with the Pickle Library |
fetch_object_classname |
Fetches the object classname |
loads |
Loads the value |
set_default_lib |
Sets the default MsgPack library |
ATTRIBUTE | DESCRIPTION |
---|---|
compression_enabled |
Returns if compression is enabled
TYPE:
|
compression_level |
Returns the compression level
TYPE:
|
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