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.0.post1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dae214b5869fca444cc5a676b8c56f7981b18e632cde7639b479976f45b9f0cb |
|
MD5 | 17d3778d96478c12d656705ca7158e80 |
|
BLAKE2b-256 | b0925aecf9391a68e3db49509e360266d9d3e5bebadb66134d21bb9610297618 |
Hashes for zopfli-0.1.0.post1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c6260eb102dd7e3e941758a54eeb2ced7f9f9f8e35c167b19cc00da6d7e2830 |
|
MD5 | e75c8dda33c5c4defe47cbd41c85f15f |
|
BLAKE2b-256 | 877ec5f1babc2f6623e55e1049cba99564b1a3e09ea0fc6ac733b3a4c3ecdaf7 |
Hashes for zopfli-0.1.0.post1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 969fa6f29d0e435506fbb112ae0c4c4aa1e2bf18090be8830f59910fd6d5fee9 |
|
MD5 | 69fb87064891a282d6404c9b85543c34 |
|
BLAKE2b-256 | a0c35d00b2aa6f8efb121695ce664ff6df34d1f846fb49c9fa15c57b83bab6bd |
Hashes for zopfli-0.1.0.post1-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70a083fd411d0559b30d788d0c23d0d2956065d58b494738849f98efec6bb1e4 |
|
MD5 | ee4724d3d423c7cbb8cf65658872ee0e |
|
BLAKE2b-256 | 0b78096c58f5753ea8943b7fe90c36b82f366840b6bd67ea5fceac5bb843030c |
Hashes for zopfli-0.1.0.post1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 335e73f6a8f437cf19fab66e0dfb456fada1efa051a98fc9f037071aea7ca5e7 |
|
MD5 | defc8eaa114a01e96d85b1c6e7a2e6ce |
|
BLAKE2b-256 | c0c57ed2fc311381a90c7cdb59d314290a68501dc5391386c6d2139bbc40a67c |
Hashes for zopfli-0.1.0.post1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a40cb135d45740236a2cbce6693edd846f173ddb98ba13df3c142a3e7bbdcc74 |
|
MD5 | 7bb0513062fafafa3aa815b236d5dd68 |
|
BLAKE2b-256 | 5c8bfa6af80ad61d256edf953d3f27b0f913c6f626db97245782e445e2379d09 |
Hashes for zopfli-0.1.0.post1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4d563a85aefc7b04e83fecdfa853aa04c3ee809525c1d8f859b2b8e2b2db5ea |
|
MD5 | dbff123ed4cb43b7e1d28025760abc65 |
|
BLAKE2b-256 | b2628db2dab09725ae1f87139b96c965e9afd6aed5f1c43a2af2288fe12fd16f |
Hashes for zopfli-0.1.0.post1-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46ae9a32dfea4eb3cf623947918d4bbc4712308dd5fc088fd7569d445bb352eb |
|
MD5 | 6cbb0a3c102d59591b2a926fbad966a4 |
|
BLAKE2b-256 | 965adb4979f1702996780960c0077d0a62af7aa53edee822a81b12d060208198 |
Hashes for zopfli-0.1.0.post1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c3d485ddf2c320ef5ee88006d105c14800f4835ab11704381a1d1062030a16 |
|
MD5 | 74b790104cfaba8ac6e5aa0904840c90 |
|
BLAKE2b-256 | 6d4f8a7762413133a16e3c38a7c6595fe57eb01d99a7e4fa0b52983cdb73c6eb |
Hashes for zopfli-0.1.0.post1-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17252085741340bd6c51da58a981faef46c9fd2727ef347938c5106b95a0e0a9 |
|
MD5 | 589ed19292de5c73c1a27327bd807b4b |
|
BLAKE2b-256 | 55725adfda922689e3bd1d60d753b38b8c385dba11bfa4dabecfb27b5b73df8c |
Hashes for zopfli-0.1.0.post1-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35a678ee795b06a06d8543c1fd84478171da32f4609df72801a6831749eaee7a |
|
MD5 | 6a92bb8caee519126dd403281af173a6 |
|
BLAKE2b-256 | 6c09b05dc36fcd0203c21f0d81b1483684c4ac7658d08ca3beaf8718bbf2995c |
Hashes for zopfli-0.1.0.post1-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1354474624540d60b925a8454d86804591e3874465d3040888449613a86e7afe |
|
MD5 | d0fb9cdda223bf8e60047f5d7ca6a080 |
|
BLAKE2b-256 | 2c848b48a07c0b14049fc27c0b605512ae8a2b088ace8c4ac4013b57bcecdf33 |
Hashes for zopfli-0.1.0.post1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 841d094e2a89371c124de380772545f1049e13cd39756dafae800d64318429bc |
|
MD5 | ef67921ab90fd3496d9233fb1714c9c7 |
|
BLAKE2b-256 | 6cd6ade0c1ec7f1d86f54b985b414577f26abed9643e8b8d26e3b7f73785061a |
Hashes for zopfli-0.1.0.post1-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f49cb4fefdff3ff33041c7844c9e6b714d7b56bcbfba7684298617a6b9b9d689 |
|
MD5 | 2146cf97a7b50fcf32e56b3b38aae367 |
|
BLAKE2b-256 | 7c87b42dc5236e97df8a0a9edbab6d952997988fb7dbead20569191905d41403 |