brotlicffi
Python CFFI bindings to the Brotli library
Decision gist · record as of 2026-08-14
Yes, if you need Brotli compression on PyPy or other non-CPython implementations, or if you prefer CFFI-based bindings over C extensions. On CPython, the native Brotli package is typically preferred for performance, but this package is a solid alternative with active maintenance, no known vulnerabilities, and permissive licensing. Install friction is moderate but manageable with pre-built wheels for common platforms.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later; PyPy support available via CFFI bindings as an alternative to the C implementation.
- Medium install friction due to compiled wheels; pre-built binaries available for common platforms (CPython 3.8+, PyPy 3.11) and architectures (x86_64, aarch64, ARM, Windows).
- Actively maintained with recent release (162 days old) and ongoing repository activity.
License · maintenance · safety
MIT (permissive) — MIT license on the Python bindings themselves; the underlying Brotli library is Apache 2.0. Both are permissive, allowing commercial and private use without restriction.
last release 2026-03-05 (162 days) · last repo commit 2026-03-05 · 153 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,252,364 downloads/mo, #2,350 on PyPI
Alternatives
Verify before relying
pip install brotlicffi
import brotlicffi
data = brotlicffi.decompress(compressed_data)- Whether the output_buffer_limit parameter (added in 1.2.0.0) is documented and how to use it effectively for security.
- Performance characteristics compared to the native Brotli C bindings on CPython.
- Thread safety guarantees beyond the documented exception for concurrent Compressor/Decompressor sharing.
What it is and what it does
BrotliCFFI is a Python wrapper around the Brotli compression algorithm, implemented using CFFI (C Foreign Function Interface) rather than C extensions. It provides both one-shot compression/decompression functions and streaming APIs for incremental processing. The package is designed as a drop-in alternative to the native Brotli C bindings, with identical API compatibility, making it particularly useful for PyPy and other non-CPython implementations where C extensions are impractical.
The library depends only on cffi and wraps the reference Brotli encoder/decoder from Google. It supports modern Python versions (3.8 through 3.14, including free-threaded builds) and multiple platforms. Recent versions include security-focused features like output buffer limits to mitigate decompression bombs, and explicit exception handling for concurrent access to compressor/decompressor objects.
Use it for
- Decompress Brotli-encoded HTTP responses in web clients or servers running PyPy or alternative Python implementations.
- Streaming compression of large files or network data using the Compressor/Decompressor classes with incremental processing.
- Cross-implementation Python projects that need Brotli support on both CPython and PyPy using conditional dependencies.
- Protect against maliciously crafted compressed data by setting output_buffer_limit on decompression operations.
- Build HTTP middleware or reverse proxies that handle Brotli content encoding on platforms where C extensions are unavailable.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need Brotli compression on PyPy or other non-CPython implementations, or if you prefer CFFI-based bindings over C extensions.
On CPython, the native Brotli package is typically preferred for performance, but this package is a solid alternative with active maintenance, no known vulnerabilities, and permissive licensing. Install friction is moderate but manageable with pre-built wheels for common platforms.
Install
brotlicffi on PyPI
Before you install
Medium install friction due to compiled wheels; pre-built binaries available for common platforms (CPython 3.8+, PyPy 3.11) and architectures (x86_64, aarch64, ARM, Windows). Actively maintained with recent release (162 days old) and ongoing repository activity.
Requires Python 3.8 or later; PyPy support available via CFFI bindings as an alternative to the C implementation.
License in practice
MIT license on the Python bindings themselves; the underlying Brotli library is Apache 2.0. Both are permissive, allowing commercial and private use without restriction.
Quickstart
pip install brotlicffi
import brotlicffi
data = brotlicffi.decompress(compressed_data)
Verify before relying
- Whether the output_buffer_limit parameter (added in 1.2.0.0) is documented and how to use it effectively for security.
- Performance characteristics compared to the native Brotli C bindings on CPython.
- Thread safety guarantees beyond the documented exception for concurrent Compressor/Decompressor sharing.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagecffi |
| Maintenance | Actively maintained 162 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,252,364 / month, #2,350 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming 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 :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Free Threading :: 2 - BetaProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: brotlicffi-1.2.0.1-cp314-cp314t-macosx_11_0_arm64.whl; brotlicffi-1.2.0.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; brotlicffi-1.2.0.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; brotlicffi-1.2.0.1-cp314-cp314t-win32.whl; brotlicffi-1.2.0.1-cp314-cp314t-win_amd64.whl; brotlicffi-1.2.0.1-cp38-abi3-macosx_11_0_arm64.whl; brotlicffi-1.2.0.1-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; brotlicffi-1.2.0.1-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; brotlicffi-1.2.0.1-cp38-abi3-win32.whl; brotlicffi-1.2.0.1-cp38-abi3-win_amd64.whl; brotlicffi-1.2.0.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl; brotlicffi-1.2.0.1-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; brotlicffi-1.2.0.1-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; brotlicffi-1.2.0.1-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 › “cffi bindings compression”
- brotlicffiProvides Python CFFI bindings to the Brotli compression library,…
- zstandardProvides Python bindings to the Zstandard compression library,…
- argon2-cffi-bindingsProvides low-level CFFI bindings to the official Argon2 password…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also brotlipy · brotli · brotli-asgi · lzfse · python-neo-lzf · cramjam · inflate64 · unlzw3 · onigurumacffi · cffi