Socket
Socket
Sign inDemoInstall

sanic-gzip

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sanic-gzip

Add compress to Sanic response as decorator


Maintainers
1

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

from sanic import Sanic
from sanic_gzip import compress

app = 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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc