kombu.compression — Kombu v1.3.2 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Kombu v1.3.2 documentation »
- API Reference »

# kombu.compression

Compression utilities.

copyright: | 2009 - 2011 by Ask Solem.
license: | BSD, see LICENSE for more details.

- Encoding/decoding
- Registry

## Encoding/decoding

`kombu.compression.` `compress`(body, content_type)

  Compress text.

  Parameters: | body – The text to compress. content_type – mime-type of compression method to use.

`kombu.compression.` `decompress`(body, content_type)

  Decompress compressed text.

  Parameters: | body – Previously compressed text to uncompress. content_type – mime-type of compression method used.

## Registry

`kombu.compression.` `encoders`()

  Returns a list of available compression methods.

`kombu.compression.` `get_encoder`(t)

  Get encoder by alias name.

`kombu.compression.` `get_decoder`(t)

  Get decoder by alias name.

`kombu.compression.` `register`(encoder, decoder, content_type, aliases=[])

  Register new compression method.

  Parameters: | encoder – Function used to compress text. decoder – Function used to decompress previously compressed text. content_type – The mime type this compression method identifies as. aliases – A list of names to associate with this compression method.

### Navigation

- index
- modules |
- next |
- previous |
- Kombu v1.3.2 documentation »
- API Reference »