Metadata-Version: 2.1
Name: flask-squeeze
Version: 1.9
Summary: Compress and minify Flask responses!
License: MIT
Author: Marcel Kröker
Author-email: kroeker.marcel@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: brotli (>=1.0.7,<2.0.0)
Requires-Dist: flask (>=1.1.2,<2.0.0)
Requires-Dist: rcssmin (>=1.0.6,<2.0.0)
Requires-Dist: rjsmin (>=1.1.0,<2.0.0)
Description-Content-Type: text/markdown

# Flask-Squeeze

Flask-Squeeze is a Flask extension that automatically:
- Minifies JS and CSS responses.
- Compresses all HTTP responses with brotli.
- Caches static files so that they don't have to be re-compressed. The cache will be cleared each time Flask restarts! Files are considered to be static if they are contained in a directory that is named "static" (Or generally, if they contain "/static/" in their request path.

## Installation
```
pip3 install Flask-Squeeze
```

## Usage
```python
from flask_squeeze import Squeeze
squeeze = Squeeze()

# Initialize Extension
squeeze.init_app(app)
```

Thats all!

## Options
You can configure Flask-Squeeze with the following options in your Flask config:
- `COMPRESS_FLAG (default=True)`: Globally enables or disables Flask-Squeeze
- `COMPRESS_MIN_SIZE (default=500)`: Defines the minimum file size in bytes to activate the brotli compression
- `COMPRESS_LEVEL_STATIC (default=11)`: Possible value are 0 (lowest) to 11 (highest). Defines the compression level of brotli for files in static folders. Theses files fill also be cached, so that they only have to be compressed once.
- `COMPRESS_LEVEL_DYNAMIC (default=5)`: Possible value are 0 (lowest) to 11 (highest). Defines the compression level of brotli for dynamic files like generated HTML files. Theses files will not be cached, so they will be compressed for each response.
- `COMPRESS_MINIFY_CSS (default=True)`: Enable or disable css minification using rcssmin.
- `COMPRESS_MINIFY_JS (default=True)`: Enable or disable css minification using rcssmin.

- `COMPRESS_VERBOSE_LOGGING (default=False)`: Enable or disable verbose logging. If enabled, Flask-Squeeze will print what it does into the terminal in a highlighted color.

