BrotliCFFI
This library contains Python CFFI bindings for the reference Brotli encoder/decoder, available here. This allows Python software to use the Brotli compression algorithm directly from Python code.
Install from PyPI:
$ python -m pip install brotlicffi
Install from Conda:
$ conda install -c conda-forge brotlicffi
To use it simply, try this:
import brotlicffi
data = brotlicffi.decompress(compressed_data)
More information can be found in the documentation.
Using BrotliCFFI in Projects
The API is 100% compatible with the Brotli Python C bindings. We recommend installing the C bindings on CPython and the CFFI bindings everywhere else (PyPy, etc)
Essentially you use requirements like this:
install_requires=[ "brotli; platform_python_implementation == 'CPython'", "brotlicffi; platform_python_implementation != 'CPython'" ]
and then import the correct Brotli library like so:
try: import brotlicffi as brotli except ImportError: import brotli
We provide an example project that shows how to use both libraries together to support Brotli with multiple Python implementations.
License
The source code of BrotliCFFI is available under the MIT license. Brotli itself is made available under the Version 2.0 of the Apache Software License. See the LICENSE and libbrotli/LICENSE files for more information.
Changelog
1.2.0.2 (2026-08-21)
Fixed a bug where Decompressor.decompress() could leave stale unconsumed input behind after fully consuming a chunk of compressed data, causing subsequent calls to fail or re-process old data.
Since cibuildwheel dropped support, this release does not include Python 3.8 wheels.
1.2.0.1 (2026-03-05)
Added support for the free-threaded build of Python 3.14.
Concurrent sharing of Compressor or Decompressor objects now raises an exception.
1.2.0.0 (2025-11-21)
Upgraded libbrotli to v1.2.0.
Added output_buffer_limit parameter to Decompressor.decompress() and Decompressor.process() methods to allow mitigation of unexpectedly large output. This addresses potential security concerns where maliciously crafted compressed data could result in excessive memory usage during decompression.
1.1.0.0 (2023-09-14)
Upgraded libbrotli to v1.1.0
Added explicit support for Python 3.10, 3.11, and 3.12
Removed support for Python 2.7, 3.5, and 3.6
1.0.9.2 (2021-04-06)
Added manylinux_aarch64 wheels
1.0.9.1 (2021-01-27)
Avoid byte/string comparison warning in error message construction
1.0.9.0 (2021-01-20)
Updated to v1.0.9 of the Brotli library
Library version now follows Brotli version
Removed the dictionary parameter from compress and Compressor
NOTE: Python 2.7 wheels for Windows likely won’t work until google/brotli#848 is resolved
0.8.0 (2020-11-30)
Renamed the package on PyPI to brotlicffi, all further updates will be published to the new package. Using the brotlipy is deprecated.
Changed the importable namespace from brotli to brotlicffi to no longer conflict with the Brotli PyPI package.
Added process() method to Compressor and Decompressor.
Added is_finished() method to Decompressor.
0.7.0 (2017-05-30)
Update to v0.6.0 of the Brotli library.
0.6.0 (2016-09-08)
Resolved a bug where decompress() would return an empty bytestring instead of erroring if the provided bytestring was small enough.
Added the finish() method to the streaming decompressor.
0.5.1 (2016-08-17)
Update to v0.5.2 of the Brotli library.
Add new exception type (Error).
Add compatibility with C++ brotli library by aliasing Error to error.
Extra error checking of input parameters to the compressor.
0.5.0 (2016-08-16)
Update to v0.5.0 of the Brotli library.
Extend one-shot compression API to include all control parameters.
Added streaming/incremental compression API.
Added flags to control compression mode.
0.4.0 (2016-08-01)
Update to v0.4.0 of the Brotli library.
0.3.0 (2016-05-11)
Update to v0.3.0 of the Brotli library.
0.2.0 (2015-10-05)
Fix broken brotli.compress support on Windows.
0.1.3 (2015-10-05)
Added basic for brotli.compress through a C wrapper included in this library.
Release files for brotlicffi 1.2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| brotlicffi-1.2.0.2.tar.gz | 478.8 kB | Details |
Built distributions (wheels)
Total release size: 10.6 MB
Release files / brotlicffi-1.2.0.2.tar.gz
| Download URL | brotlicffi-1.2.0.2.tar.gz |
|---|---|
| Size | 478.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e0fbd13644cf1f6015e75fa5e0ad8fdce1048d9c9ff90b0ce826174b249ee35
|
|
BLAKE2b-256 checksum How to use checksums |
71977845739a36828ffe751a1c6b240692f552fd7ecf65026c51326c0a4aa369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-pp311-pypy311_pp73-win_amd64.whl
| Download URL | brotlicffi-1.2.0.2-pp311-pypy311_pp73-win_amd64.whl |
|---|---|
| Size | 378.4 kB |
| Tags | PyPy 3.11 PyPy 3.11 7.3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5eb5563173afb92c9111b180349ff17d7c83c79febabadca5de983b552565c3c
|
|
BLAKE2b-256 checksum How to use checksums |
4e1717c22d48819001ca08cadab63b09b00e0c56a7579478aa7c2623f4280de6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 402.9 kB |
| Tags | Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 PyPy 3.11 PyPy 3.11 7.3 |
|
SHA-256 checksum How to use checksums |
fc7647657e4f3d73eab591910dbecb57d1ecaea7aa3dd04e6d704a2756fe0c59
|
|
BLAKE2b-256 checksum How to use checksums |
6e6cea8e3d34e1d64c5e5a920bb0c89bf9e92badf973937a60922820395e622d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 406.8 kB |
| Tags | Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 PyPy 3.11 PyPy 3.11 7.3 |
|
SHA-256 checksum How to use checksums |
dbb81489562dd5363bf86d9a8edb0ec8c97049b0819ba4936fc023e8847248bc
|
|
BLAKE2b-256 checksum How to use checksums |
e1c7a253288e66ee340f2f6320eda7022daa723f2918438d586a59e9c998aa27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl
| Download URL | brotlicffi-1.2.0.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl |
|---|---|
| Size | 407.5 kB |
| Tags | PyPy 3.11 PyPy 3.11 7.3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
cf500bb9e02e1474ced1ecf22f74c568de2816b3627af6352ec51ac5e09e60ee
|
|
BLAKE2b-256 checksum How to use checksums |
37daa5b65a86725d772504a348193cf1fab5ad6410794b422bf81faa17a96a66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp314-cp314t-win_amd64.whl
| Download URL | brotlicffi-1.2.0.2-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 386.1 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
908add8a9c0eea00f5de799dc6de9f6d205d9ee11afabc7c03d6812c481200e2
|
|
BLAKE2b-256 checksum How to use checksums |
ee0b83cac3075721fe4c253ea1cc5310cb687c2f7d987e0fd60eb3ed769c24c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp314-cp314t-win32.whl
| Download URL | brotlicffi-1.2.0.2-cp314-cp314t-win32.whl |
|---|---|
| Size | 346.8 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-32 |
|
SHA-256 checksum How to use checksums |
8f3f9bd61293dc48359763e693951393f39656086315067cf97e23e23e8911ab
|
|
BLAKE2b-256 checksum How to use checksums |
24ccc32630b042ec2a13e8342e6ecb6b9d3531b1be4647b733d6fd365976041c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
97bae40d45ebc2a6ac7b1c9b30825496a257192194b672ef5869e2df93467f69
|
|
BLAKE2b-256 checksum How to use checksums |
9fd674cee9f9fbea8c42030a81056c64e092030a95bd2756ea83da1d1e8f5f29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
0636cb5a85f31c36e08953d09a226cb788be900b976f81302895e3cf35d5e707
|
|
BLAKE2b-256 checksum How to use checksums |
0d9c506dc8edabb3cf9339c89f1ecc80a218aa166bb83b9f2e9cc1da67314072
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | brotlicffi-1.2.0.2-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 438.8 kB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ad05ca993234cf947f0ad71b1c8bc0af3d74e0410b1e2c32bb99de0cef6a994b
|
|
BLAKE2b-256 checksum How to use checksums |
77a2edda4f3fc7143434402eacad1e91433fe68ae648c22738eeddb6138638ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp39-abi3-win_amd64.whl
| Download URL | brotlicffi-1.2.0.2-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 379.8 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
489ca4da3ee65926d72bf01584b61088a9da6bdd1bb01b2040901e1beaffa8f0
|
|
BLAKE2b-256 checksum How to use checksums |
95aeafd54e744df93b51cc29f6a19beccf9998b25743d7177697390de10479d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp39-abi3-win32.whl
| Download URL | brotlicffi-1.2.0.2-cp39-abi3-win32.whl |
|---|---|
| Size | 342.4 kB |
| Tags | CPython 3.9 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
df1d34c4ad9adbf7f63a6b42f7d0e4dfd259c88141b85145b57abecc1abc3b24
|
|
BLAKE2b-256 checksum How to use checksums |
35dd31ae9945cbd605339fb51c9a609f7dbb182cd361adeabc1d470142357206
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
22916101de0e7ff535f2edf54b52a85591853b8ae9a98737643defdd3c063a3a
|
|
BLAKE2b-256 checksum How to use checksums |
0678076419ed6c2c6aa3eaac6fd6b076502b4be89d50625fcdc513cd4aeca718
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ec6b1af7b7a8ce788354f2c603651ada0fba166ec31ab879e2eec462a3e6dbf4
|
|
BLAKE2b-256 checksum How to use checksums |
ef22d8fd1a4d09b7ab563b89380395e09151d2ef1344be31594df6a6987d4028
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency logRelease files / brotlicffi-1.2.0.2-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | brotlicffi-1.2.0.2-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 438.9 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d5a8ffa154f16660ab818d78045b55fa6f9970f1ca4c38998766e99c672071cb
|
|
BLAKE2b-256 checksum How to use checksums |
2e71c27f24b8334f65f2492601c7764338f156cb904d2ffe0061e6004a76d9cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 21, 2026.
Transparency log