zopfli
Zopfli module for python
Decision gist · record as of 2026-08-14
Yes, if you need denser compression and can tolerate slower encoding. The library is actively maintained, has no known vulnerabilities, and carries a permissive license. Install friction is moderate due to compiled extensions, but prebuilt wheels minimize friction on common platforms. Not worth installing if encoding speed is your priority or if standard zlib compression is sufficient for your use case.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or greater.
- Medium install friction due to compiled C extensions, but prebuilt wheels cover modern Python versions (3.10+) and common platforms.
- Actively maintained with recent releases.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 is permissive; you can use this in commercial and proprietary projects with minimal restrictions, provided you include a copy of the license.
last release 2026-06-10 (65 days) · last repo commit 2026-06-10 · 14 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 36,363,196 downloads/mo, #733 on PyPI
Alternatives
Verify before relying
from zopfli.zlib import compress
from zlib import decompress
s = b'Hello World'
print(decompress(compress(s)))- Actual compression ratio improvement over standard zlib for typical workloads
- Performance trade-offs (CPU time vs. file size reduction) for different numiterations values
- Whether streaming support is planned or available in a fork
What it is and what it does
Zopfli wraps Google's Zopfli compression algorithm as a Python module, offering denser compression than standard zlib and gzip at the cost of slower encoding. It exposes two main entry points: zopfli.zlib.compress for deflate-compatible output and zopfli.gzip.compress for gzip-compatible output. Both accept keyword arguments to tune compression behavior—numiterations controls how many optimization passes to run, blocksplitting enables multi-block deflate output for better compression, and blocksplittingmax caps the number of blocks.
The package is a straightforward C extension with no runtime dependencies, making it lightweight to integrate into existing Python workflows. It requires Python 3.10 or greater and is actively maintained with prebuilt wheels for CPython and PyPy across major platforms. Use it when file size matters more than encoding speed, such as in asset pipelines, archival systems, or scenarios where bandwidth or storage is a bottleneck.
Use it for
- Compress static assets (CSS, JavaScript, images) in build pipelines where smaller downloads justify slower encoding
- Archive large datasets or logs where disk space is constrained and one-time compression cost is acceptable
- Optimize gzip payloads in web services where bandwidth savings outweigh server CPU overhead
- Prepare distribution packages or firmware images where file size reduction is critical
- Benchmark or compare compression algorithms in research or performance analysis workflows
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need denser compression and can tolerate slower encoding.
The library is actively maintained, has no known vulnerabilities, and carries a permissive license. Install friction is moderate due to compiled extensions, but prebuilt wheels minimize friction on common platforms. Not worth installing if encoding speed is your priority or if standard zlib compression is sufficient for your use case.
Install
zopfli on PyPI
Before you install
Medium install friction due to compiled C extensions, but prebuilt wheels cover modern Python versions (3.10+) and common platforms. Actively maintained with recent releases.
Requires Python 3.10 or greater.
License in practice
Apache-2.0 is permissive; you can use this in commercial and proprietary projects with minimal restrictions, provided you include a copy of the license.
Quickstart
from zopfli.zlib import compress
from zlib import decompress
s = b'Hello World'
print(decompress(compress(s)))
Verify before relying
- Actual compression ratio improvement over standard zlib for typical workloads
- Performance trade-offs (CPU time vs. file size reduction) for different numiterations values
- Whether streaming support is planned or available in a fork
Package 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 65 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 36,363,196 / month, #733 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: System :: Archiving :: Compression |
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
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “high-density compression library”
- zopfliZopfli is a Python binding for Google's Zopfli compression library,…
- colorcetColorcet provides a collection of perceptually uniform colormaps…
- lz4Python bindings for the LZ4 compression library, providing frame and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Compression packages
Provides Python bindings to the Brotli compression library, enabling lossless compression and decompression using a modern LZ77 variant with Huffman coding and context modeling.
Install it if you need Brotli compression in Python; the API is straightforward and the library is battle-tested.
Provides Zstandard compression support for Python versions before 3.14, backporting the standard library's zstd module along with zstd-enabled tarfile and zipfile modules.
Python binding for Google's Snappy compression library, providing fast compression and decompression of data via the cramjam backend.
However, dormant maintenance (715 days since last release) means security or compatibility issues may not be addressed quickly.
pyzipper replaces Python's standard zipfile module to read and write AES-encrypted zip archives, using the WinZip AES encryption specification.
Provides Python bindings to the Zstandard (zstd) compression library with an API similar to bz2, lzma, and zlib modules.
Compresses and decompresses Rich Text Format (RTF) data using the LZFu compression algorithm, implementing the Microsoft RTF Compression format.
However, maintenance is aging with no recent updates; verify that it meets your RTF variant requirements before relying on it for new projects.
See also python-lzf · zlib-ng · lz4 · zlib-state · deflate · gzip-stream · pgzip · mgzip · python-neo-lzf