zopfli
Zopfli module for python
Install
zopfli on PyPI
pip
pip install zopfliuv
uv add zopflipoetry
poetry add zopfliPackage facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 64 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: zopfli-0.4.3-cp310-abi3-macosx_10_9_universal2.whl; zopfli-0.4.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; zopfli-0.4.3-cp310-abi3-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; zopfli-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl; zopfli-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl; zopfli-0.4.3-cp310-abi3-win32.whl; zopfli-0.4.3-cp310-abi3-win_amd64.whl; zopfli-0.4.3-cp310-abi3-win_arm64.whl; zopfli-0.4.3-pp311-pypy311_pp73-macosx_10_15_x86_64.whl; zopfli-0.4.3-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; zopfli-0.4.3-pp311-pypy311_pp73-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; zopfli-0.4.3-pp311-pypy311_pp73-win_amd64.whl
About zopfli
from the package's own PyPI description — quoted content, verbatim
|Build Status|
PYZOPFLI
cPython bindings for
zopfli <http://googledevelopers.blogspot.com/2013/02/compress-data-more-densely-with-zopfli.html>__.
It requires Python 3.10 or greater.
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 wraps 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 arguments. 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...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
Zopfli provides Python bindings to Google's Zopfli compression library, enabling denser gzip and zlib compression than standard algorithms at the cost of slower encoding.
Medium friction: precompiled wheels cover CPython 3.10+ and PyPy 3.11 across Linux, macOS, and Windows, but the package requires Python 3.10 minimum. Actively maintained with a recent release (64 days old) and no runtime dependencies.
Apache-2.0 is permissive; you may use, modify, and distribute zopfli freely in commercial and private projects provided you include the license notice.
Usage
pip install zopfli
from zopfli.zlib import compress
from zlib import decompress
compressed = compress(b'Hello World')
original = decompress(compressed)
Requires Python 3.10 or greater.
Verdict: Zopfli is a well-maintained, actively developed compression library with broad platform support and no security vulnerabilities. The Apache-2.0 license is permissive. Install friction is moderate due to the Python 3.10+ requirement and precompiled-wheel dependency, but wheels are widely available. Suitable for projects prioritizing compression ratio over encoding speed.
Needs verification
- Whether the compression speed penalty is acceptable for your use case (fact sheet does not quantify performance trade-offs).
- Whether the iterative compression parameters (numiterations, blocksplitting) are well-tuned for your data type and size.
Similar packages
permissive · top 1,000 on PyPI
fonttoolspermissive · top 1,000 on PyPI
httplib2permissive · top 1,000 on PyPI
brotlipermissive · top 1,000 on PyPI
lz4permissive · top 1,000 on PyPI
pdf2imagepermissive · top 1,000 on PyPI
zstandardpermissive · top 1,000 on PyPI
partdpermissive · top 1,000 on PyPI
kafka-pythonpermissive · top 1,000 on PyPI
fastarpermissive · top 1,000 on PyPI