--- id: zopfli version: "0.4.3" license: Apache-2.0 license_treatment: permissive maintenance: active --- # zopfli — Zopfli module for python License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install zopfli uv add zopfli poetry add zopfli ## Description |Build Status| PYZOPFLI ======== cPython bindings for `zopfli `__. 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... ## AI interpretation — verify before relying 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. 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. [View on SkillFed](https://skillfed.io/packages/zopfli) · [View on PyPI](https://pypi.org/project/zopfli/)