Skip to main content

BrotliCFFI

Version Version-Conda Downloads CI Status

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.

Authors

BrotliCFFI/brotlipy was authored by Cory Benfield and is currently maintained by Seth Michael Larson.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brotlicffi-1.2.0.2.tar.gz (478.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

brotlicffi-1.2.0.2-pp311-pypy311_pp73-win_amd64.whl (378.4 kB view details)

Uploaded PyPyWindows x86-64

brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (402.9 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (406.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

brotlicffi-1.2.0.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl (407.5 kB view details)

Uploaded PyPymacOS 11.0+ ARM64

brotlicffi-1.2.0.2-cp314-cp314t-win_amd64.whl (386.1 kB view details)

Uploaded CPython 3.14tWindows x86-64

brotlicffi-1.2.0.2-cp314-cp314t-win32.whl (346.8 kB view details)

Uploaded CPython 3.14tWindows x86

brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

brotlicffi-1.2.0.2-cp314-cp314t-macosx_11_0_arm64.whl (438.8 kB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

brotlicffi-1.2.0.2-cp39-abi3-win_amd64.whl (379.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

brotlicffi-1.2.0.2-cp39-abi3-win32.whl (342.4 kB view details)

Uploaded CPython 3.9+Windows x86

brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

brotlicffi-1.2.0.2-cp39-abi3-macosx_11_0_arm64.whl (438.9 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file brotlicffi-1.2.0.2.tar.gz.

File metadata

  • Download URL: brotlicffi-1.2.0.2.tar.gz
  • Upload date:
  • Size: 478.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for brotlicffi-1.2.0.2.tar.gz
Algorithm Hash digest
SHA256 5e0fbd13644cf1f6015e75fa5e0ad8fdce1048d9c9ff90b0ce826174b249ee35
MD5 150c15ed39aa90d6d7deae519a0768ce
BLAKE2b-256 71977845739a36828ffe751a1c6b240692f552fd7ecf65026c51326c0a4aa369

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2.tar.gz:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 5eb5563173afb92c9111b180349ff17d7c83c79febabadca5de983b552565c3c
MD5 3022b46252128877ed8f4d5637585475
BLAKE2b-256 4e1717c22d48819001ca08cadab63b09b00e0c56a7579478aa7c2623f4280de6

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-pp311-pypy311_pp73-win_amd64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc7647657e4f3d73eab591910dbecb57d1ecaea7aa3dd04e6d704a2756fe0c59
MD5 41c958fac7a19246ea6b9cb7d790fcf6
BLAKE2b-256 6e6cea8e3d34e1d64c5e5a920bb0c89bf9e92badf973937a60922820395e622d

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 dbb81489562dd5363bf86d9a8edb0ec8c97049b0819ba4936fc023e8847248bc
MD5 154571d4c750e0cc5c9bdba4443799bd
BLAKE2b-256 e1c7a253288e66ee340f2f6320eda7022daa723f2918438d586a59e9c998aa27

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf500bb9e02e1474ced1ecf22f74c568de2816b3627af6352ec51ac5e09e60ee
MD5 fb5fa99e83673499c6db208c23f65149
BLAKE2b-256 37daa5b65a86725d772504a348193cf1fab5ad6410794b422bf81faa17a96a66

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 908add8a9c0eea00f5de799dc6de9f6d205d9ee11afabc7c03d6812c481200e2
MD5 e4956dfee5d1115be9da815f5bdb08b2
BLAKE2b-256 ee0b83cac3075721fe4c253ea1cc5310cb687c2f7d987e0fd60eb3ed769c24c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp314-cp314t-win_amd64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp314-cp314t-win32.whl.

File metadata

  • Download URL: brotlicffi-1.2.0.2-cp314-cp314t-win32.whl
  • Upload date:
  • Size: 346.8 kB
  • Tags: CPython 3.14t, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for brotlicffi-1.2.0.2-cp314-cp314t-win32.whl
Algorithm Hash digest
SHA256 8f3f9bd61293dc48359763e693951393f39656086315067cf97e23e23e8911ab
MD5 620767ddee4b4d1a963ddeda6e2833ad
BLAKE2b-256 24ccc32630b042ec2a13e8342e6ecb6b9d3531b1be4647b733d6fd365976041c

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp314-cp314t-win32.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 97bae40d45ebc2a6ac7b1c9b30825496a257192194b672ef5869e2df93467f69
MD5 f85680db1e2cee3f769f18ba7ab1f440
BLAKE2b-256 9fd674cee9f9fbea8c42030a81056c64e092030a95bd2756ea83da1d1e8f5f29

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0636cb5a85f31c36e08953d09a226cb788be900b976f81302895e3cf35d5e707
MD5 7d428bc34668721ba9b85cc52d718f0f
BLAKE2b-256 0d9c506dc8edabb3cf9339c89f1ecc80a218aa166bb83b9f2e9cc1da67314072

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad05ca993234cf947f0ad71b1c8bc0af3d74e0410b1e2c32bb99de0cef6a994b
MD5 2ff19ddabfdd4dc7884ea2d61261b3cd
BLAKE2b-256 77a2edda4f3fc7143434402eacad1e91433fe68ae648c22738eeddb6138638ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: brotlicffi-1.2.0.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 379.8 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for brotlicffi-1.2.0.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 489ca4da3ee65926d72bf01584b61088a9da6bdd1bb01b2040901e1beaffa8f0
MD5 30e4b569695d7b7fc7f86ba1dd60d0db
BLAKE2b-256 95aeafd54e744df93b51cc29f6a19beccf9998b25743d7177697390de10479d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp39-abi3-win_amd64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp39-abi3-win32.whl.

File metadata

  • Download URL: brotlicffi-1.2.0.2-cp39-abi3-win32.whl
  • Upload date:
  • Size: 342.4 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for brotlicffi-1.2.0.2-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 df1d34c4ad9adbf7f63a6b42f7d0e4dfd259c88141b85145b57abecc1abc3b24
MD5 b1e6f3102385ef78dc61d3985389ca81
BLAKE2b-256 35dd31ae9945cbd605339fb51c9a609f7dbb182cd361adeabc1d470142357206

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp39-abi3-win32.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 22916101de0e7ff535f2edf54b52a85591853b8ae9a98737643defdd3c063a3a
MD5 c8751622b1a38c939ec6655918b760c8
BLAKE2b-256 0678076419ed6c2c6aa3eaac6fd6b076502b4be89d50625fcdc513cd4aeca718

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ec6b1af7b7a8ce788354f2c603651ada0fba166ec31ab879e2eec462a3e6dbf4
MD5 53d052197f4a990d9975d1f5530a9101
BLAKE2b-256 ef22d8fd1a4d09b7ab563b89380395e09151d2ef1344be31594df6a6987d4028

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brotlicffi-1.2.0.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for brotlicffi-1.2.0.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5a8ffa154f16660ab818d78045b55fa6f9970f1ca4c38998766e99c672071cb
MD5 edd8d74d0add0550ccf0074c68a6d8ae
BLAKE2b-256 2e71c27f24b8334f65f2492601c7764338f156cb904d2ffe0061e6004a76d9cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for brotlicffi-1.2.0.2-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: ci.yml on python-hyper/brotlicffi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.2.0.2 This release

15 files

1.2.0.1

15 files

1.2.0.0

15 files

1.1.0.0

27 files

1.0.9.2

30 files

1.0.9.1

29 files

1.0.9.0

29 files

0.8.0

31 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page