This document describes the current stable version of Kombu (4.2). For development docs, go here.

Message Serialization - kombu

Serialization utilities.


Centralized support for encoding/decoding of data structures. Contains json, pickle, msgpack, and yaml serializers.

Optionally installs support for YAML if the PyYAML package is installed.

Optionally installs support for msgpack if the msgpack-python package is installed.


exception kombu.serialization.SerializerNotInstalled[source]

Support for the requested serialization type is not installed.



Special case serializer.


kombu.serialization.register(name, encoder, decoder, content_type, content_encoding=u'utf-8')

Register a new encoder/decoder.

  • name (str) – A convenience name for the serialization method.
  • encoder (callable) – A method that will be passed a python data structure and should return a string representing the serialized data. If None, then only a decoder will be registered. Encoding will not be possible.
  • decoder (Callable) – A method that will be passed a string representing serialized data and should return a python data structure. If None, then only an encoder will be registered. Decoding will not be possible.
  • content_type (str) – The mime-type describing the serialized structure.
  • content_encoding (str) – The content encoding (character set) that the decoder method will be returning. Will usually be utf-8, us-ascii, or binary.
kombu.serialization.registry = <kombu.serialization.SerializerRegistry object>

Global registry of serializers/deserializers.