--- id: deflate version: "0.8.1" license: unclear license_treatment: permissive maintenance: active --- # deflate — Python wrapper for libdeflate. License: permissive · Maintenance: active · Downloads: 331.7K/mo ## What it is and what it does deflate is a thin Python binding to Eric Biggers' libdeflate C library, exposing compression and decompression for gzip, raw DEFLATE, and zlib formats. It also provides CRC32 and Adler-32 checksum functions. The package is built as a compiled extension with pre-compiled wheels for common platforms, so installation typically requires no build step. You use it when you need faster compression than Python's built-in zlib module, or when you want to work with raw DEFLATE or zlib data streams where the original decompressed size must be tracked separately. The API is minimal: functions like gzip_compress, deflate_decompress, and crc32 take byte strings and optional parameters (compression level, initial checksum state) and return the result directly. Use it for: - Compress large text or binary payloads for network transmission or storage when speed matters more than standard library zlib. - Decompress gzip or zlib data received from external sources with a simpler API than the standard library. - Compute rolling CRC32 or Adler-32 checksums across multiple data chunks for integrity verification. - Work with raw DEFLATE streams where you manage the original size separately, as required by some protocols. - Replace zlib in performance-critical paths where libdeflate's faster implementation reduces CPU overhead. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Thin Python wrapper around libdeflate for fast gzip, DEFLATE, and zlib compression/decompression, plus CRC32 and Adler-32 checksum computation. Yes, if you need faster compression/decompression than the standard library and are comfortable with a compiled dependency. The package is actively maintained, has no known vulnerabilities, and offers pre-compiled wheels for most platforms. Install friction is medium but manageable. Not necessary if standard library zlib meets your performance needs. ## Install pip install deflate uv add deflate poetry add deflate ## Installing deflate Before you install: Pre-compiled wheels available for common platforms (macOS, Linux, Windows, multiple architectures). Medium install friction due to compiled C extension, but wheels reduce build overhead. Active maintenance with last commit 2026-08-01. License in practice: MIT license (permissive); you can use this freely in commercial and private projects with minimal restrictions. Quickstart: pip install deflate import deflate compressed = deflate.gzip_compress(b"hello world!" * 1000, level=6) original = deflate.gzip_decompress(compressed) Requires Python 3.9 or later. Pre-compiled wheels available; building from source requires a C compiler and optionally LIBDEFLATE_PREFIX environment variable if linking to system libdeflate. Verify before relying: - Performance comparison with standard library zlib or other compression libraries to justify adoption. - Whether the compression level range (1-12 for libdeflate) offers practical benefits over standard zlib (1-9). - API stability and backward compatibility guarantees across future releases. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 331.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags gzip compression decompression, deflate compression library, zlib wrapper python, crc32 adler32 checksum, libdeflate python binding, fast data compression, deflate raw compression, compression, c-extension, checksum [View on SkillFed](https://skillfed.io/packages/deflate) · [View on PyPI](https://pypi.org/project/deflate/)