GitHub - python-hyper/brotlicffi: Python bindings to the Brotli compression library | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

python-hyper/brotlicffi

Repository files navigation

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.

About

Python bindings to the Brotli compression library

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors 16

Languages

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.