Zopfli module for python
Project description
PYZOPFLI
cPython bindings for zopfli.
USAGE
pyzopfli is a straight forward wrapper around zopfli’s ZlibCompress method.
from zopfli.zlib import compress from zlib import decompress s = 'Hello World' print decompress(compress(s))
pyzopfli also wrapps GzipCompress, but the API point does not try to mimic the gzip module.
from zopfli.gzip import compress from StringIO import StringIO from gzip import GzipFile print GzipFile(fileobj=StringIO(compress("Hello World!"))).read()
Both zopfli.zlib.compress and zopfli.gzip.compress support the following keyword arguements. All values should be integers; boolean parmaters are treated as expected, 0 and >0 as false and true.
verbose dumps zopfli debugging data to stderr
numiterations Maximum amount of times to rerun forward and backward pass to optimize LZ77 compression cost. Good values: 10, 15 for small files, 5 for files over several MB in size or it will be too slow.
blocksplitting If true, splits the data in multiple deflate blocks with optimal choice for the block boundaries. Block splitting gives better compression. Default: true (1).
blocksplittinglast If true, chooses the optimal block split points only after doing the iterative LZ77 compression. If false, chooses the block split points first, then does iterative LZ77 on each individual block. Depending on the file, either first or last gives the best compression. Default: false (0).
blocksplittingmax Maximum amount of blocks to split into (0 for unlimited, but this can give extreme results that hurt compression on some files). Default value: 15.
TODO
Stop reading the entire file into memory and support streaming
Monkey patch zlib and gzip so code with an overly tight binding can be easily modified to use zopfli.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for zopfli-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d51f95bcf36dd98454959d515c32ad27a2d5f1af4af0c8816735cb336c07612d |
|
MD5 | bad94f28bc6136c0db154dae8660a02e |
|
BLAKE2b-256 | a421f407b0dfd69baaa445d4a5530c77e262e18bd6e6f2c3a8af9afc1d785755 |
Hashes for zopfli-0.1.2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae44007436ffb2d54a60efb662b7f79e8788c64fb51c640d4455c438f722feac |
|
MD5 | 6f7a41d8895de336e3fbea82e8d86fe7 |
|
BLAKE2b-256 | 35e76e6897650acc83f1b033a30352de30fed86cf66e642608d18b036c4516c4 |
Hashes for zopfli-0.1.2-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e15e5529f2429c4d2ce957a1ea6d451fa602daf0a8b832749c6074cd0eb144a |
|
MD5 | 8cfd408ff8838743d1cd51d247f86c95 |
|
BLAKE2b-256 | ca6537ea60fda669715e98c0fc052c52c18e548c9a752b8c8c3d96faae81356a |
Hashes for zopfli-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 981ee395423a6edc0d60d3047c274932ae1213623a417aa36d24b40e3f7132d6 |
|
MD5 | 01cdef782b812db739932b8e1cb32a6d |
|
BLAKE2b-256 | 491fa81e4ba675637f9329e143f39fd4a42aa385f64783f49ba70a58317cbb24 |
Hashes for zopfli-0.1.2-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df8f13c26bb9ae7cad51f9468b551da6699686e718e32f90fb381c614e40bb99 |
|
MD5 | ad65de3ec30ec72ce41307741fa2ba3a |
|
BLAKE2b-256 | ab3cdabb7d46e4ea4186bcde21cdace96f353fbe2e1392f17a5d8c1467507941 |
Hashes for zopfli-0.1.2-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 117478d8ad5d8cb66e4dfe2e125588b023a81fce76e94bf6b5c7724cdf0651ac |
|
MD5 | c67ed0c231066e8077c49f686ef3c61f |
|
BLAKE2b-256 | dc650013662f69e2c94ecf402c3ee452463dd003168eb8b0acabbe736113e0de |
Hashes for zopfli-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e500b6ebecdef57b12c693571a7f2e79a8b822fa686771c587bcff6fe36800b |
|
MD5 | e109263a6297634b5f818d499637c424 |
|
BLAKE2b-256 | a9243c4c2333247fb52df66fa93fa470fca5e3828b9468b340331fd09ba7935e |
Hashes for zopfli-0.1.2-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2213d92e1de0de0b181af55e280e4060186926be76e24f4b7605c28fde50f95 |
|
MD5 | 22cbe16f0082f6136985ad971dcd80c0 |
|
BLAKE2b-256 | 801179f6d11aa2352439e5bfdb0286b1a006b3248543db1c742e9e44b3174e2a |
Hashes for zopfli-0.1.2-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224fe056eab8bbe5fecff1a6b5ccadcbf9338807879ba974190d88c95d942129 |
|
MD5 | 9a895c6e9ff7abcace50e918421a94af |
|
BLAKE2b-256 | 1c788f11aedd9e13968c4beefb488a1320e600b0e25977f242e39f7a54705a13 |
Hashes for zopfli-0.1.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8f480d365c261c12bacbeffa7da10c176c684da854843dff6edd34ae21aa13b |
|
MD5 | b0bd94eb718f8cd81704dd1c3a022a15 |
|
BLAKE2b-256 | 103fa78636ad6c03ef53f80bb750b8cf8e0dba1d42a25eb7afe2fd5d4ab0f1e6 |
Hashes for zopfli-0.1.2-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f594673ea3c175091f9c14ded161ab4d574480ef763d01c6bd76416051993ff |
|
MD5 | f9b583792eb81f8ef8c153393618a402 |
|
BLAKE2b-256 | d6d1c2b2e5a998515e1d76e366249abd0ac830eb5719a2e52bdf5c627ccc9ed4 |
Hashes for zopfli-0.1.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81f3dd7bd0979bbb1bf10789c62f6faba90b7a8b78d86cde5cf7543e2a6a82bd |
|
MD5 | 324d9690b9b5e00c3dc08635b618b2c3 |
|
BLAKE2b-256 | 888f2cbe8ff8dddf55e03b394813ae80d9c2418fba38db6f702aaa287ef8ec0a |