A Python bindings for Zopfli
Project description
Installation
$ pip install zopflipy
Requirements
Python 3.9+
Usage
ZopfliCompressor
>>> import zopfli
>>> c = zopfli.ZopfliCompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)
>>> z = c.compress(b'Hello, world!') + c.flush()
>>> d = zopfli.ZopfliDecompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)
>>> d.decompress(z) + d.flush()
b'Hello, world!''
ZopfliDeflater
>>> import zopfli
>>> c = zopfli.ZopfliDeflater()
>>> z = c.compress(b'Hello, world!') + c.flush()
>>> d = zopfli.ZopfliDecompressor(zopfli.ZOPFLI_FORMAT_DEFLATE)
>>> d.decompress(z) + d.flush()
b'Hello, world!''
ZopfliPNG
>>> import zopfli
>>> png = zopfli.ZopfliPNG()
>>> with open('in.png', 'rb') as fp:
... data = fp.read()
>>> len(png.optimize(data)) < len(data)
True
ZipFile
A subclass of zipfile.ZipFile which uses ZopfliCompressor for the zipfile.ZIP_DEFLATED compression method.
>>> import zipfile
>>> import zopfli
>>> with zopfli.ZipFile('a.zip', 'w', zipfile.ZIP_DEFLATED) as zf:
... zf.writestr('a.txt', b'Hello, world!')
License
ZopfliPy is distributed under the terms of the Apache License, Version 2.0.
Project details
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
File details
Details for the file zopflipy-1.11.tar.gz
.
File metadata
- Download URL: zopflipy-1.11.tar.gz
- Upload date:
- Size: 178.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8778087a66df69f32d357630599f0c890343b960d30100284cbc635e81495b0 |
|
MD5 | df99e4e8ba99b2fc85a9126c1e116751 |
|
BLAKE2b-256 | 6cd00d34336e944e039642de20a185eaab94fa8f44e43237f9e9ab3b1b403565 |
File details
Details for the file zopflipy-1.11-cp313-cp313-win_amd64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 104.1 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5117cc0aeba2ca6ba627ee736e7a46c4b4066ae8da583bcdddccb98ad23b4cb4 |
|
MD5 | 4cfba22a66823050d728384b789cf357 |
|
BLAKE2b-256 | 241e0f2b7fe2ad4255a6cc53827b235ebf72fb7feefe04c65e9113c447ca71df |
File details
Details for the file zopflipy-1.11-cp313-cp313-win32.whl
.
File metadata
- Download URL: zopflipy-1.11-cp313-cp313-win32.whl
- Upload date:
- Size: 84.0 kB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 257268632d3e37dee04649b8ff223688721bee625b60f04d29bd4a8c4d46adac |
|
MD5 | 74db2cdae4e0fd5458f3173c3b8529c1 |
|
BLAKE2b-256 | 5af74398679a7ea4182679d329e6e1ca4ba753cac8041abc1f888f87e71a8fd4 |
File details
Details for the file zopflipy-1.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 897.4 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d67c9b25852e22bb6d559a9751888fc780356f1276dfc606f7a9fe14688c039 |
|
MD5 | 96c928f21d3fa533b1cd078044c8cffe |
|
BLAKE2b-256 | 100eb3dd3d10c31aefd2570f838322f9c88ea2611b8d4e9b9c30d6031f82784f |
File details
Details for the file zopflipy-1.11-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: zopflipy-1.11-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 869.8 kB
- Tags: CPython 3.13, manylinux: glibc 2.12+ i686, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3147b285743f835e4353395b417dc47c827f7ccc2161b639cb923710523f0a6 |
|
MD5 | d13edb59e66316ba0be72190de4364a7 |
|
BLAKE2b-256 | 24fdc4fa739b47e6db9d28efe74cebc3900dc53033f5dfd489762fffe337bc6b |
File details
Details for the file zopflipy-1.11-cp313-cp313-macosx_10_13_universal2.whl
.
File metadata
- Download URL: zopflipy-1.11-cp313-cp313-macosx_10_13_universal2.whl
- Upload date:
- Size: 306.2 kB
- Tags: CPython 3.13, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e87c3aaaa4b1dbf322f70832801be7d61a1195dc4d172fcdf7aef3fa2910e891 |
|
MD5 | 5daf59f2aa119023f0f9323d0df4442e |
|
BLAKE2b-256 | 2071d96a4addccd31955ad7b484a9a20ed247f40ce82cbdf48d3433c04ae1b02 |
File details
Details for the file zopflipy-1.11-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 104.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5144001d2db41e3e974a0fa3ee9f2fe329de832991a220580f8b66ab1e4d8d26 |
|
MD5 | f86d06fe14a134694f4d86742f6dcd55 |
|
BLAKE2b-256 | 58f261d9209fa3c3d57243e1debda9d0d531b2f886b55fb10be357364c4d14c9 |
File details
Details for the file zopflipy-1.11-cp312-cp312-win32.whl
.
File metadata
- Download URL: zopflipy-1.11-cp312-cp312-win32.whl
- Upload date:
- Size: 84.0 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fe488dca0624ee89d4174c67f27e2d89033bd32ce91e0da6bc45b1322ccc9b4 |
|
MD5 | 09b58d017ca5ca148af277c536b1cb5d |
|
BLAKE2b-256 | ac336953f4c7111b5bdf4212e8668bd0995fa80c3117bcfd77436652bba0e250 |
File details
Details for the file zopflipy-1.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 897.5 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79a8270851ae91d0461fd0410dcd6f4366db5c680a421afeda34ba00af9e4bec |
|
MD5 | 5a06dea3a2bb69b95bd8bb1a41b206ff |
|
BLAKE2b-256 | 11c66c4e0a362f7d20da3f66ebb0b5d77ea7fa9d8efd01169ae0c38d70429637 |
File details
Details for the file zopflipy-1.11-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: zopflipy-1.11-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 869.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.12+ i686, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d59cd9e533a0c70ed6d73998dbf89db1255bf05a51e2813cc7963849dc4a6c11 |
|
MD5 | e9338c3f9e70c5fac124b44355504ddf |
|
BLAKE2b-256 | b9d5a29d3fda5a5b64ab502c5d6941a8b2e0eb9d00c958f9f9cfcad215dbe7a6 |
File details
Details for the file zopflipy-1.11-cp312-cp312-macosx_10_13_universal2.whl
.
File metadata
- Download URL: zopflipy-1.11-cp312-cp312-macosx_10_13_universal2.whl
- Upload date:
- Size: 306.2 kB
- Tags: CPython 3.12, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f75fda3bde46290e8c3b914c95d66dc9e327efddb5832c068135a7d61ed15430 |
|
MD5 | 19958402078ba52b747c86150b3cb095 |
|
BLAKE2b-256 | 23f0ee07744d8125b0e684a2950a50ecc4b6630d3a57f945ebc982cca2d3a3cd |
File details
Details for the file zopflipy-1.11-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 103.9 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ae8282cf177be0d562f77146efb48e439da838d8a2ac535cfaacb9c3dcf0453 |
|
MD5 | e5a449b110363cf3459e298cdf554e01 |
|
BLAKE2b-256 | 7904ac7e91fbe212fe5809e0605ef83ff26a81cd18c98c71000fc46a79b5e6c9 |
File details
Details for the file zopflipy-1.11-cp311-cp311-win32.whl
.
File metadata
- Download URL: zopflipy-1.11-cp311-cp311-win32.whl
- Upload date:
- Size: 83.9 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43c2a309d5584f8744d5528be6347fcc2ab5da95744892c324203c41f3caf033 |
|
MD5 | fcb7937b213f1fc985d5407f7c98905c |
|
BLAKE2b-256 | 558ce0dde840a2c2064592f4bd8d8d132772a6f861e2644972ae8d4a7f383a12 |
File details
Details for the file zopflipy-1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 896.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2549381e88ff013cb87814679387fbba22749f78b6d411679d74dda639535df |
|
MD5 | b9eaf0f1f7e09231911a9492c46d39db |
|
BLAKE2b-256 | c9ef27e3a0c8a1a57f1def659c72f904687294cfa7e347b128a61eba3a7c2d4a |
File details
Details for the file zopflipy-1.11-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: zopflipy-1.11-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 869.0 kB
- Tags: CPython 3.11, manylinux: glibc 2.12+ i686, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 082b81d6f7a8a3166e354fe6c6ec32451bc5dba010e1b063ccc7172c473d4bda |
|
MD5 | 817d719d730b8bbefad25c14c114c9b8 |
|
BLAKE2b-256 | ac4b35f35ac52cde761de9d3aa5f181a24d883d4e9194c7e86dde4383afba36a |
File details
Details for the file zopflipy-1.11-cp311-cp311-macosx_10_9_universal2.whl
.
File metadata
- Download URL: zopflipy-1.11-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 308.1 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a9b7417fa1e746c15c78e5e4b834fbac66ad9568fedd646828ff102c4c1c4c9 |
|
MD5 | ffc65d9918a53e770cce8df7bb26c394 |
|
BLAKE2b-256 | 1486e6a8942689e9027d76705de585fb3681117eef192309b5077eb9727ab19a |
File details
Details for the file zopflipy-1.11-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 103.9 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ebe91dbb0a5da4185c33549fc699fd247ae4ee55819cc7f5b0735b8fb998ebf |
|
MD5 | 6ddf0ce346238268535dd6b7118621be |
|
BLAKE2b-256 | 8c36e39fd2d2861ef2e4c002528d74cf7a142a9ba25eb8974621dc7ef3eaf3ea |
File details
Details for the file zopflipy-1.11-cp310-cp310-win32.whl
.
File metadata
- Download URL: zopflipy-1.11-cp310-cp310-win32.whl
- Upload date:
- Size: 83.9 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdac1ac6b437e155c812ef32e373da7f641692d6beb45d8d592db950e4186a6c |
|
MD5 | c219473428172f268f22faa009d30e6e |
|
BLAKE2b-256 | 3f7fd544b22053929712c5185fb8c27f1676fdc9ec24b671533aeb36bbbb4de4 |
File details
Details for the file zopflipy-1.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 894.8 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 970f251d15695f9ee4b74a857416d6f7282237c917b142f94bad3eb658e8104b |
|
MD5 | 4bc13dd324487d1ed8872dde1ae21714 |
|
BLAKE2b-256 | a27bf280b0490d0a41113b386bf8db1a681d9ebdc3ceabcce39bee89081fb931 |
File details
Details for the file zopflipy-1.11-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: zopflipy-1.11-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 867.2 kB
- Tags: CPython 3.10, manylinux: glibc 2.12+ i686, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a06dfbe11a5adc6453ced17443696053566a2a664b119e0c5be9c42e42f4439 |
|
MD5 | 9ccd5d19f3639b52388b76b089d36720 |
|
BLAKE2b-256 | 42f441daad75ac406c64c264e90ad0370eb1afa660709d2f4f5bef76abb51855 |
File details
Details for the file zopflipy-1.11-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: zopflipy-1.11-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 308.1 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d7ba48c3b513fc04189d86c205eeb7fca8717eebaaa36a1f551fbb32eb0f4ed |
|
MD5 | eed1113ea6a9801b04fda45f91380dba |
|
BLAKE2b-256 | dcce3f21e9d3da0c44376289a8c0224a7c598c1558a615e2cfa1e0d96ea7fb9f |
File details
Details for the file zopflipy-1.11-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 103.9 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdffb969afd855ba30a99582a0d30ce61a7eef2e8956c56ace4e488e52947e68 |
|
MD5 | ae54c28d512ccdc765dd3a576a524c9c |
|
BLAKE2b-256 | 9b5ff668d740f7b02d589f6fa7712502b7e6ad5f8a062f0d268841cce80c8e2d |
File details
Details for the file zopflipy-1.11-cp39-cp39-win32.whl
.
File metadata
- Download URL: zopflipy-1.11-cp39-cp39-win32.whl
- Upload date:
- Size: 83.9 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad88fd9852fc1ec86d48a5a5947bd7239d4ad9149947210b2ae9e1bf525a79fd |
|
MD5 | dbb2156bc2c09c47e9677a172d298bc0 |
|
BLAKE2b-256 | c678f77a96572adb8e45b115afe8f9374262b6b26da40b3d70ac117692070a90 |
File details
Details for the file zopflipy-1.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: zopflipy-1.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 894.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b222f5ae2fd9b68ecb3a24fb2080b0a4cdcccfd32c399479a6d27594c0754b56 |
|
MD5 | 8b7648204dbce923426e5496be600b21 |
|
BLAKE2b-256 | cbaf5ee8bc5d8c5a13fe30b515b43ef5b1764d34bac6e55bccb9d7f5312ba4b4 |
File details
Details for the file zopflipy-1.11-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: zopflipy-1.11-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 866.7 kB
- Tags: CPython 3.9, manylinux: glibc 2.12+ i686, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a41907c1144964da1d62120cd56262a49c24ef8f957ae44b12475c3bb6fb437 |
|
MD5 | 8bdd60f1fd38b18d7ebbc710664f9007 |
|
BLAKE2b-256 | 214c074e7e50fddc7324f3513e9ba49e7aa37ed50c3a66524aed4051d820dc16 |
File details
Details for the file zopflipy-1.11-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: zopflipy-1.11-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 308.1 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53f67f48e87237536345805e68eeffd818096acb578107df5875fbdb64e96d9b |
|
MD5 | ceebc9df78361e705b9c6f1a51ba6e12 |
|
BLAKE2b-256 | 73086927ee7fcc423986304c51c2fd78d2ca40acdfb625d891f61d2ce01d4c02 |