Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Python bindings to the Brotli compression library

License

NotificationsYou must be signed in to change notification settings

python-hyper/brotlicffi

Repository files navigation

VersionVersion-CondaDownloadsCI Status

This library contains Python CFFI bindings for the reference Brotli encoder/decoder,available here. This allows Python software to use the Brotli compressionalgorithm 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:

importbrotlicffidata=brotlicffi.decompress(compressed_data)

More information can be foundin the documentation.

Using BrotliCFFI in Projects

The API is 100% compatible with theBrotli Python C bindings.We recommend installing the C bindings on CPython and the CFFIbindings 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:importbrotlicffiasbrotliexceptImportError:importbrotli

We provide anexample project that shows how to use bothlibraries together to support Brotli with multiple Python implementations.

License

The source code of BrotliCFFI is available under the MIT license. Brotli itselfis made available under the Version 2.0 of the Apache Software License. See theLICENSE and libbrotli/LICENSE files for more information.

Authors

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


[8]ページ先頭

©2009-2025 Movatter.jp