summaryrefslogtreecommitdiff
path: root/reference/kombu.compression.html
blob: 42aa632346459f3af52a5d8e9dc0b881423b6975 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>kombu.compression &mdash; Kombu 2.1.3 documentation</title>
    
    <link rel="stylesheet" href="../_static/celery.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.1.3',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Kombu 2.1.3 documentation" href="../index.html" />
    <link rel="up" title="API Reference" href="index.html" />
    <link rel="next" title="General Pools - kombu.pools" href="kombu.pools.html" />
    <link rel="prev" title="kombu.serialization" href="kombu.serialization.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="kombu.pools.html" title="General Pools - kombu.pools"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="kombu.serialization.html" title="kombu.serialization"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Kombu 2.1.3 documentation</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">API Reference</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-kombu.compression"></span><div class="section" id="kombu-compression">
<h1>kombu.compression<a class="headerlink" href="#kombu-compression" title="Permalink to this headline">¶</a></h1>
<p>Compression utilities.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">copyright:</th><td class="field-body"><ol class="first loweralpha simple" start="3">
<li>2009 - 2012 by Ask Solem.</li>
</ol>
</td>
</tr>
<tr class="field-even field"><th class="field-name">license:</th><td class="field-body"><p class="first last">BSD, see LICENSE for more details.</p>
</td>
</tr>
</tbody>
</table>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#encoding-decoding" id="id1">Encoding/decoding</a></li>
<li><a class="reference internal" href="#registry" id="id2">Registry</a></li>
</ul>
</div>
<div class="section" id="encoding-decoding">
<h2><a class="toc-backref" href="#id1">Encoding/decoding</a><a class="headerlink" href="#encoding-decoding" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="kombu.compression.compress">
<tt class="descclassname">kombu.compression.</tt><tt class="descname">compress</tt><big>(</big><em>body</em>, <em>content_type</em><big>)</big><a class="headerlink" href="#kombu.compression.compress" title="Permalink to this definition">¶</a></dt>
<dd><p>Compress text.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>body</strong> &#8211; The text to compress.</li>
<li><strong>content_type</strong> &#8211; mime-type of compression method to use.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="kombu.compression.decompress">
<tt class="descclassname">kombu.compression.</tt><tt class="descname">decompress</tt><big>(</big><em>body</em>, <em>content_type</em><big>)</big><a class="headerlink" href="#kombu.compression.decompress" title="Permalink to this definition">¶</a></dt>
<dd><p>Decompress compressed text.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>body</strong> &#8211; Previously compressed text to uncompress.</li>
<li><strong>content_type</strong> &#8211; mime-type of compression method used.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
<div class="section" id="registry">
<h2><a class="toc-backref" href="#id2">Registry</a><a class="headerlink" href="#registry" title="Permalink to this headline">¶</a></h2>
<dl class="function">
<dt id="kombu.compression.encoders">
<tt class="descclassname">kombu.compression.</tt><tt class="descname">encoders</tt><big>(</big><big>)</big><a class="headerlink" href="#kombu.compression.encoders" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of available compression methods.</p>
</dd></dl>

<dl class="function">
<dt id="kombu.compression.get_encoder">
<tt class="descclassname">kombu.compression.</tt><tt class="descname">get_encoder</tt><big>(</big><em>t</em><big>)</big><a class="headerlink" href="#kombu.compression.get_encoder" title="Permalink to this definition">¶</a></dt>
<dd><p>Get encoder by alias name.</p>
</dd></dl>

<dl class="function">
<dt id="kombu.compression.get_decoder">
<tt class="descclassname">kombu.compression.</tt><tt class="descname">get_decoder</tt><big>(</big><em>t</em><big>)</big><a class="headerlink" href="#kombu.compression.get_decoder" title="Permalink to this definition">¶</a></dt>
<dd><p>Get decoder by alias name.</p>
</dd></dl>

<dl class="function">
<dt id="kombu.compression.register">
<tt class="descclassname">kombu.compression.</tt><tt class="descname">register</tt><big>(</big><em>encoder</em>, <em>decoder</em>, <em>content_type</em>, <em>aliases=</em><span class="optional">[</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#kombu.compression.register" title="Permalink to this definition">¶</a></dt>
<dd><p>Register new compression method.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>encoder</strong> &#8211; Function used to compress text.</li>
<li><strong>decoder</strong> &#8211; Function used to decompress previously compressed text.</li>
<li><strong>content_type</strong> &#8211; The mime type this compression method identifies as.</li>
<li><strong>aliases</strong> &#8211; A list of names to associate with this compression method.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper"><p class="logo"><a href="../index.html">
  <img class="logo" width="128" height="128" src="http://cloud.github.com/downloads/ask/kombu/kombusmall.jpg" alt="Logo"/>
</a></p>
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">kombu.compression</a><ul>
<li><a class="reference internal" href="#encoding-decoding">Encoding/decoding</a></li>
<li><a class="reference internal" href="#registry">Registry</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="kombu.serialization.html"
                        title="previous chapter">kombu.serialization</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="kombu.pools.html"
                        title="next chapter">General Pools - kombu.pools</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/reference/kombu.compression.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="kombu.pools.html" title="General Pools - kombu.pools"
             >next</a> |</li>
        <li class="right" >
          <a href="kombu.serialization.html" title="kombu.serialization"
             >previous</a> |</li>
        <li><a href="../index.html">Kombu 2.1.3 documentation</a> &raquo;</li>
          <li><a href="index.html" >API Reference</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2009-2012, Ask Solem.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
    </div>
  </body>
</html>