Python CFFI bindings to the Brotli library
Project description
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.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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for brotlicffi-1.1.0.0-pp310-pypy310_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce01c7316aebc7fce59da734286148b1d1b9455f89cf2c8a4dfce7d41db55c2d |
|
MD5 | 55540a7efbe9926ba5112deba4a56306 |
|
BLAKE2b-256 | 72a90971251c4427c14b2a827dba3d910d4d3330dabf23d4278bf6d06a978847 |
Hashes for brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54a07bb2374a1eba8ebb52b6fafffa2afd3c4df85ddd38fcc0511f2bb387c2a8 |
|
MD5 | 6f8b0ae2dafd6abd99ecb5f55a7db654 |
|
BLAKE2b-256 | e59515aa422aa6450e6556e54a5fd1650ff59f470aed77ac739aa90ab63dc611 |
Hashes for brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7b0033b0d37bb33009fb2fef73310e432e76f688af76c156b3594389d81391 |
|
MD5 | 0ceb737edbc28866a742ba9e5f98dc18 |
|
BLAKE2b-256 | 54101fd57864449360852c535c2381ee7120ba8f390aa3869df967c44ca7eba1 |
Hashes for brotlicffi-1.1.0.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7901a7dc4b88f1c1475de59ae9be59799db1007b7d059817948d8e4f12e24e35 |
|
MD5 | 2bdb012cd7a4c2892bcf5be06548ee13 |
|
BLAKE2b-256 | 6ca7f254e13b2cb43337d6d99a4ec10394c134e41bfda8a2eff15b75627f4a3d |
Hashes for brotlicffi-1.1.0.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e4aeb0bd2540cb91b069dbdd54d458da8c4334ceaf2d25df2f4af576d6766ca |
|
MD5 | f1088272ffecf0ecf7ed4778aa2e15a0 |
|
BLAKE2b-256 | e53bbd4f3d2bcf2306ae66b0346f5b42af1962480b200096ffc7abc3bd130eca |
Hashes for brotlicffi-1.1.0.0-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9eb71bb1085d996244439154387266fd23d6ad37161f6f52f1cd41dd95a3808 |
|
MD5 | 8ad0b06218b7d60272a93e1767a94ff9 |
|
BLAKE2b-256 | 40162a29a625a6f74d13726387f83484dfaaf6fcdaafaadfbe26a0412ae268cc |
Hashes for brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de0cf28a53a3238b252aca9fed1593e9d36c1d116748013339f0949bfc84112 |
|
MD5 | 4c2da9c178234ae776652755e65dd36d |
|
BLAKE2b-256 | 502a699388b5e489726991132441b55aff0691dd73c49105ef220408a5ab98d6 |
Hashes for brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa8ca0623b26c94fccc3a1fdd895be1743b838f3917300506d04aa3346fd2a14 |
|
MD5 | ec757388941cac581636dab9b4d17b3a |
|
BLAKE2b-256 | 4f7fa16534d28386f74781db8b4544a764cf955abae336379a76f50e745bb0ee |
Hashes for brotlicffi-1.1.0.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6be5ec0e88a4925c91f3dea2bb0013b3a2accda6f77238f76a34a1ea532a1cb0 |
|
MD5 | 87b480e9e606eb2b8151ad3e4c9f890e |
|
BLAKE2b-256 | 4a3f58254e7fbe6011bf043e4dcade0e16995a9f82b731734fad97220d201f42 |
Hashes for brotlicffi-1.1.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a807d760763e398bbf2c6394ae9da5815901aa93ee0a37bca5efe78d4ee3171 |
|
MD5 | 8700d211e3c2bb8ce3d1c5b4bdb281d9 |
|
BLAKE2b-256 | 359be0b577351e1d9d5890e1a56900c4ceaaef783b807145cd229446a43cf437 |
Hashes for brotlicffi-1.1.0.0-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f3711be9290f0453de8eed5275d93d286abe26b08ab4a35d7452caa1fef532f |
|
MD5 | 6fd20591f8af7f55416bab49f3dbac27 |
|
BLAKE2b-256 | 4bdfd81660ba62bb54cefd6e95d5315710a8871ebf0872a4bd61b13388181742 |
Hashes for brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a7ae37e5d79c5bdfb5b4b99f2715a6035e6c5bf538c3746abc8e26694f92f33 |
|
MD5 | c2752174bf5d4da5b1abd10674a4d580 |
|
BLAKE2b-256 | 502262b4bf874a0be46e79bb46db4e52533f757d85107ee0cdfcc800314e865f |
Hashes for brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8557a8559509b61e65083f8782329188a250102372576093c88930c875a69838 |
|
MD5 | b5be938c93e5ec5f648350cbe49a18b9 |
|
BLAKE2b-256 | 852d9e8057f9c73c29090ce885fe2a133c17082ce2aa0712c533a52a5aeb042f |
Hashes for brotlicffi-1.1.0.0-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 391151ec86bb1c683835980f4816272a87eaddc46bb91cbf44f62228b84d8cca |
|
MD5 | 46f58fe0a90d5a382502a036656a33dd |
|
BLAKE2b-256 | ffcb648a47cd457a3afe3bacdfcd62e89fde6666be503d06403a6c2f157b7d61 |
Hashes for brotlicffi-1.1.0.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6068e0f3769992d6b622a1cd2e7835eae3cf8d9da123d7f51ca9c1e9c333e5 |
|
MD5 | 00398623353bc8405d7f1dda9f8fe77c |
|
BLAKE2b-256 | 75ffe227f8547f5ef11d861abae091d5dc012c2b1eb2e7358eff429fafbd608e |
Hashes for brotlicffi-1.1.0.0-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | add0de5b9ad9e9aa293c3aa4e9deb2b61e99ad6c1634e01d01d98c03e6a354cc |
|
MD5 | d962b215ff75000fa78f0489c0569609 |
|
BLAKE2b-256 | bb0b300170bbcabfcc6c99a01a09efbc4749a728230bcbc474ca9a7c66082bcd |
Hashes for brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37c26ecb14386a44b118ce36e546ce307f4810bc9598a6e6cb4f7fca725ae7e6 |
|
MD5 | dea60ffde3bd79edc1280e8ebe6270e0 |
|
BLAKE2b-256 | eba401c44dbc6fbfc31021ca38850064f097f12d47e5e8d2096a714a0f5446d7 |
Hashes for brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc4bc5d82bc56ebd8b514fb8350cfac4627d6b0743382e46d033976a5f80fab6 |
|
MD5 | 8a13aa770782c464600ed8ae980b668a |
|
BLAKE2b-256 | def9fbb6c16c482ae17a35e2c913e68b8b041c440da64104a3324944bdfa90b9 |
Hashes for brotlicffi-1.1.0.0-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca72968ae4eaf6470498d5c2887073f7efe3b1e7d7ec8be11a06a79cc810e990 |
|
MD5 | c11ae7239183d9e37e0ccb99ed15565a |
|
BLAKE2b-256 | 7f3013a95f94c29c26443a9c28bdf7ad1bc879f15352f72edd417edbb57ac6b5 |
Hashes for brotlicffi-1.1.0.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 246f1d1a90279bb6069de3de8d75a8856e073b8ff0b09dcca18ccc14cec85979 |
|
MD5 | 68d13d62834db072716fa137d61b684d |
|
BLAKE2b-256 | 66ec6380a5aa95fc0f2f863fd5151b4a503ce7e2f22e75dcbbc08267a068fbb8 |
Hashes for brotlicffi-1.1.0.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 994a4f0681bb6c6c3b0925530a1926b7a189d878e6e5e38fae8efa47c5d9c613 |
|
MD5 | 21c74a01fd156c92265c0da43343457f |
|
BLAKE2b-256 | 1cfa5408a03c041114ceab628ce21766a4ea882aa6f6f0a800e04ee3a30ec6b9 |
Hashes for brotlicffi-1.1.0.0-cp37-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b12b50e07c3911e1efa3a8971543e7648100713d4e0971b13631cce22c587eb |
|
MD5 | c6339e85fb581838bf379c8059cf6f32 |
|
BLAKE2b-256 | b440b961a702463b6005baf952794c2e9e0099bde657d0d7e007f923883b907f |
Hashes for brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9feb210d932ffe7798ee62e6145d3a757eb6233aa9a4e7db78dd3690d7755814 |
|
MD5 | 95838586fd0d01cfb63a7e2115e53fdd |
|
BLAKE2b-256 | be20201559dff14e83ba345a5ec03335607e47467b6633c210607e693aefac40 |
Hashes for brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19ffc919fa4fc6ace69286e0a23b3789b4219058313cf9b45625016bf7ff996b |
|
MD5 | 91b8b6cda0490c67f8d2d982042686d6 |
|
BLAKE2b-256 | d6e6a8f46f4a4ee7856fbd6ac0c6fb0dc65ed181ba46cd77875b8d9bbe494d9e |
Hashes for brotlicffi-1.1.0.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84763dbdef5dd5c24b75597a77e1b30c66604725707565188ba54bab4f114820 |
|
MD5 | 8be7e227bac479564ab63f51f104a9c4 |
|
BLAKE2b-256 | cd15695b1409264143be3c933f708a3f81d53c4a1e1ebbc06f46331decbf6563 |
Hashes for brotlicffi-1.1.0.0-cp37-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b7ae6bd1a3f0df532b6d67ff674099a96d22bc0948955cb338488c31bfb8851 |
|
MD5 | 003fbfd45f536ad3816f7cdc2febd459 |
|
BLAKE2b-256 | a2117b96009d3dcc2c931e828ce1e157f03824a69fb728d06bfd7b2fc6f93718 |