Serialization - redish.serialization

class redish.serialization.Pickler(encoding=None)

The pickle serializer.

deserialize(value)
Decode pickled value to Python object.
serialize(value)
Encode value to pickle format.
class redish.serialization.Plain(encoding=None)

A pass-through serializer.

Values will not be serialized.

class redish.serialization.Serializer(encoding=None)

Base class for serializers.

Parameter:encoding – Optional encoding applied after serialization, and before deserialization.

Example using compression:

>>> s = Pickler(encoding="zlib")
>>> val = s.encode({"foo: "bar"})>>> 
s.decode(val)

Serializers must implement the serialize() and deserialize() methods. Both take a single argument, which is the value to serialize/deserialize.

decode(value)
Decode value.
encode(value)
Encode value.

Previous topic

Models - redish.models

Next topic

Utilities - redish.utils

This Page