Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koug44/sanic-gzip
A Sanic plugin to manage compression as a decorator
https://github.com/koug44/sanic-gzip
Last synced: 2 months ago
JSON representation
A Sanic plugin to manage compression as a decorator
- Host: GitHub
- URL: https://github.com/koug44/sanic-gzip
- Owner: koug44
- License: mit
- Created: 2019-09-16T20:38:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-04T20:56:06.000Z (about 3 years ago)
- Last Synced: 2024-09-18T01:37:13.028Z (4 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sanic - Sanic Gzip
README
# sanic-gzip
A Sanic plugin to manage compression as a decorator## Installation
Install with `pip`:
`pip install sanic-gzip`
## Usage
Usage is as simple as a decorator before your function
```python
from sanic import Sanic
from sanic_gzip import compressapp = Sanic(__name__)
compress = Compress()@app.get("/logs")
@compress.compress()
async def my_verbose_function(request):
```The current version supports both gzip and deflate algorithms.
## Options
Config options are to be setted as init argument:
* Compression min. size
* Compression level
* MIME types impacted
* Number of threadused for compression