Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/python-hyper/brotlicffi
Python bindings to the Brotli compression library
https://github.com/python-hyper/brotlicffi
brotli python
Last synced: 12 days ago
JSON representation
Python bindings to the Brotli compression library
- Host: GitHub
- URL: https://github.com/python-hyper/brotlicffi
- Owner: python-hyper
- License: mit
- Created: 2015-10-02T08:45:45.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T20:56:02.000Z (2 months ago)
- Last Synced: 2024-10-29T15:41:16.100Z (12 days ago)
- Topics: brotli, python
- Language: Python
- Homepage:
- Size: 237 KB
- Stars: 147
- Watchers: 16
- Forks: 27
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
BrotliCFFI
==========.. image:: https://img.shields.io/pypi/v/brotlicffi
:alt: Version
:target: https://pypi.org/project/brotlicffi.. image:: https://img.shields.io/conda/vn/conda-forge/brotlicffi
:alt: Version-Conda
:target: https://anaconda.org/conda-forge/brotlicffi.. image:: https://pepy.tech/badge/brotlicffi
:alt: Downloads
:target: https://pepy.tech/project/brotlicffi.. image:: https://img.shields.io/github/workflow/status/python-hyper/brotlicffi/CI/master
:alt: CI Status
:target: https://github.com/python-hyper/brotlicffi/actionsThis 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:
.. code-block::
$ python -m pip install brotlicffi
Install from Conda:
.. code-block::
$ conda install -c conda-forge brotlicffi
To use it simply, try this:
.. code-block:: python
import brotlicffi
data = brotlicffi.decompress(compressed_data)More information can be found `in the documentation`_.
.. _available here: https://github.com/google/brotli
.. _in the documentation: https://brotlipy.readthedocs.orgUsing 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:
.. code-block:: python
install_requires=[
"brotli; platform_python_implementation == 'CPython'",
"brotlicffi; platform_python_implementation != 'CPython'"
]and then import the correct Brotli library like so:
.. code-block:: python
try:
import brotlicffi as brotli
except ImportError:
import brotliWe provide an `example project`_ that shows how to use both
libraries together to support Brotli with multiple Python implementations... _Brotli Python C bindings: https://pypi.org/project/Brotli
.. _example project: https://github.com/python-hyper/brotlipy/tree/master/exampleLicense
-------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.