Registry / devops / quart-compress

quart-compress

JSON →
library0.2.1pypypi✓ verified 86d ago

Quart-Compress is a lightweight extension for Quart apps that compresses responses using gzip or brotli. It is inspired by Flask-Compress and provides easy integration to reduce response sizes. The current version is 0.2.1. Release cadence is low; it's a stable, maintenance-level package.

pip install quart-compress
INSTALL
IMPORT
SIG · QUART-COMPRESS
Q
quart-compress
devopspythonv0.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Compress
from quart_compress import Compress
from quart_compress import quert_compress
Common typo in import name

Basic Quart app with gzip compression enabled by default.

from quart import Quart from quart_compress import Compress app = Quart(__name__) compress = Compress() compress.init_app(app) @app.route('/') async def index(): return 'Hello, World!' if __name__ == '__main__': app.run()
Debug
Known issues
gotchaCompression is automatically applied to all responses. To exclude certain endpoints, you must set a custom minimum size or modify app configuration.
fix
Use app.config['COMPRESS_MIN_SIZE'] = 500 # bytes to set a minimum threshold
affects: all
deprecatedBrotli support requires the brotli library, which may not be installed by default. Without it, only gzip is available.
fix
pip install brotli
affects: all
gotchaQuart-Compress does not compress responses with Content-Encoding already set (e.g., from reverse proxy). This can cause double compression if not configured properly.
fix
Ensure you are not compressing at both app and proxy level.
affects: all
breakingIn version 0.2.0, the import path changed from 'quart_compress' (no dash) to 'quart_compress' (underscore). If you used a dash in import, it will break.
fix
Use 'from quart_compress import Compress' with underscore.
affects: >=0.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'quart_compress'
Package not installed or import name misspelled.
fix
Run 'pip install quart-compress' and import with 'from quart_compress import Compress'.
ImportError: cannot import name 'Compress' from 'quart_compress'
Old version or wrong symbol name.
fix
Update package: 'pip install --upgrade quart-compress'. Ensure you use 'Compress' (capital C).
AttributeError: 'Compress' object has no attribute 'init_app'
Using a very old version (pre-0.1.0) or incorrect usage.
fix
Upgrade to latest version: 'pip install --upgrade quart-compress'
Upgrade
Version history
0.2.1latest on PyPI · released Jun 19, 2020
Audit
Dependencies
quartrequiredRequired: Quart web framework
brotlioptionalOptional: enables brotli compression
Agent activity
6 hits · last 30 days
node
6
Resources
quart-compress — pip install quart-compress · libregistry