Popular recipes tagged "decompression" but not "compression"http://code.activestate.com/recipes/tags/decompression-compression/2016-03-17T12:22:10-07:00ActiveState Code RecipesDecrypt a PDF using fitz / MuPDF (PyMuPDF) (Python)
2016-03-17T12:22:10-07:00Harald Liederhttp://code.activestate.com/recipes/users/4191581/http://code.activestate.com/recipes/580627-decrypt-a-pdf-using-fitz-mupdf-pymupdf/
<p style="color: grey">
Python
recipe 580627
by <a href="/recipes/users/4191581/">Harald Lieder</a>
(<a href="/recipes/tags/decompression/">decompression</a>, <a href="/recipes/tags/decryption/">decryption</a>, <a href="/recipes/tags/pdf/">pdf</a>, <a href="/recipes/tags/repair/">repair</a>).
</p>
<p>It's more a code snippet. Shows how to dynamically check whether a PDF is password protected. If it is, decrypt it and save it back to disk un-encrypted.</p>
De-chunk and decompress HTTP body (Python)
2015-06-30T03:31:31-07:00Vovanhttp://code.activestate.com/recipes/users/4192447/http://code.activestate.com/recipes/579075-de-chunk-and-decompress-http-body/
<p style="color: grey">
Python
recipe 579075
by <a href="/recipes/users/4192447/">Vovan</a>
(<a href="/recipes/tags/chunked/">chunked</a>, <a href="/recipes/tags/content/">content</a>, <a href="/recipes/tags/dechunking/">dechunking</a>, <a href="/recipes/tags/decompression/">decompression</a>, <a href="/recipes/tags/encoding/">encoding</a>, <a href="/recipes/tags/http/">http</a>, <a href="/recipes/tags/preprocess/">preprocess</a>, <a href="/recipes/tags/transfer/">transfer</a>).
Revision 2.
</p>
<p>Example read_body_stream() usage:</p>
<pre class="prettyprint"><code>with open(http_file_path, 'rb') as fh:
print(b''.join(httputil.read_body_stream(
fh, chunked=True, compression=httputil.GZIP))
</code></pre>