{ "info": { "author": "Jethro Muller, William Fagan", "author_email": "git@jethromuller.co.za, libwilliam@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Quart-Compress\n\n[![Version](https://img.shields.io/pypi/v/quart-compress.svg)](https://pypi.python.org/pypi/quart-compress)\n[![Build Status](https://travis-ci.org/AceFire6/quart-compress.svg?branch=master)](https://travis-ci.org/AceFire6/quart-compress)\n[![Coverage Status](https://coveralls.io/repos/github/AceFire6/quart-compress/badge.svg?branch=master)](https://coveralls.io/github/AceFire6/quart-compress?branch=master)\n[![License](https://img.shields.io/pypi/l/quart-compress.svg)](https://github.com/AceFire6/quart-compress/blob/master/LICENSE.txt)\n\nQuart-Compress allows you to easily compress your [Quart](https://pgjones.gitlab.io/quart/) application's responses with gzip.\n\nThe preferred solution is to have a server (like [Nginx](http://wiki.nginx.org/Main)) automatically compress the static files for you. If you don't have that option Quart-Compress will solve the problem for you.\n\n\n## How it works\n\nQuart-Compress both adds the various headers required for a compressed response and gzips the response data. This makes serving gzip compressed static files extremely easy.\n\nInternally, every time a request is made the extension will check if it matches one of the compressible MIME types and will automatically attach the appropriate headers.\n\n\n## Installation\n\nIf you use pip then installation is simply:\n\n```shell\n$ pip install quart-compress\n```\n\nor, if you want the latest github version:\n\n```shell\n$ pip install git+git://github.com/AceFire6/quart-compress.git\n```\n\n## Using Quart-Compress\n\nQuart-Compress is incredibly simple to use. In order to start gzip'ing your Quart application's assets, the first thing to do is let Quart-Compress know about your [`quart.Quart`](https://pgjones.gitlab.io/quart/source/quart.app.html#quart.app.Quart) application object.\n\n```python\nfrom quart import Quart\nfrom quart_compress import Compress\n\napp = Quart(__name__)\nCompress(app)\n```\n\nIn many cases, however, one cannot expect a Quart instance to be ready at import time, and a common pattern is to return a Quart instance from within a function only after other configuration details have been taken care of. In these cases, Quart-Compress provides a simple function, `quart_compress.Compress.init_app`, which takes your application as an argument.\n\n```python\nfrom quart import Quart\nfrom quart_compress import Compress\n\ncompress = Compress()\n\ndef start_app():\n app = Quart(__name__)\n compress.init_app(app)\n return app\n```\n\nIn terms of automatically compressing your assets using gzip, passing your [`quart.Quart`](https://pgjones.gitlab.io/quart/source/quart.app.html#quart.app.Quart) object to the `quart_compress.Compress` object is all that needs to be done.\n\n\n## Options\n\nWithin your Quart application's settings you can provide the following settings to control the behavior of Quart-Compress. None of the settings are required.\n\n| Option | Description | Default |\n| ------ | ----------- | ------- |\n| `COMPRESS_MIMETYPES` | Set the list of mimetypes to compress here. | `[`
`'text/html',`
`'text/css',`
`'text/xml',`
`'application/json',`
`'application/javascript'`
`]` |\n| `COMPRESS_LEVEL` | Specifies the gzip compression level. | `6` |\n| `COMPRESS_MIN_SIZE` | Specifies the minimum file size threshold for compressing files. | `500` |\n| `COMPRESS_CACHE_KEY` | Specifies the cache key method for lookup/storage of response data. | `None` |\n| `COMPRESS_CACHE_BACKEND` | Specified the backend for storing the cached response data. | `None` |\n| `COMPRESS_REGISTER` | Specifies if compression should be automatically registered. | `True` |\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/AceFire6/quart-compress", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "quart-compress", "package_url": "https://pypi.org/project/quart-compress/", "platform": "any", "project_url": "https://pypi.org/project/quart-compress/", "project_urls": { "Homepage": "https://github.com/AceFire6/quart-compress" }, "release_url": "https://pypi.org/project/quart-compress/0.1.0/", "requires_dist": [ "Quart (==0.10.0)", "Brotli (==1.0.7)" ], "requires_python": "", "summary": "Compress responses in your Quart app with gzip or brotli.", "version": "0.1.0" }, "last_serial": 5765284, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8557a40c62dfad60ce3ad42359285d82", "sha256": "a9b8c83bbc3727377a089b40fe9cd02698245ab56b78204ce23d430a6a33d72b" }, "downloads": -1, "filename": "quart_compress-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8557a40c62dfad60ce3ad42359285d82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7740, "upload_time": "2019-08-31T20:36:04", "url": "https://files.pythonhosted.org/packages/23/3f/fefff5a49af9ca87934e7620d4d97e0adfc40515de322714cf5cd0c84738/quart_compress-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ddf68edf93646579265cdb7021b82bc9", "sha256": "7eb6f728aeb3fcecd766a49605c58eaa8285106c44a09642a433c19654a3299c" }, "downloads": -1, "filename": "quart-compress-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ddf68edf93646579265cdb7021b82bc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6442, "upload_time": "2019-08-31T20:36:07", "url": "https://files.pythonhosted.org/packages/fb/62/5b608682da26436cf87faa2abd61fed15f0821b79df95027cf1eb28a556f/quart-compress-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8557a40c62dfad60ce3ad42359285d82", "sha256": "a9b8c83bbc3727377a089b40fe9cd02698245ab56b78204ce23d430a6a33d72b" }, "downloads": -1, "filename": "quart_compress-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8557a40c62dfad60ce3ad42359285d82", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7740, "upload_time": "2019-08-31T20:36:04", "url": "https://files.pythonhosted.org/packages/23/3f/fefff5a49af9ca87934e7620d4d97e0adfc40515de322714cf5cd0c84738/quart_compress-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ddf68edf93646579265cdb7021b82bc9", "sha256": "7eb6f728aeb3fcecd766a49605c58eaa8285106c44a09642a433c19654a3299c" }, "downloads": -1, "filename": "quart-compress-0.1.0.tar.gz", "has_sig": false, "md5_digest": "ddf68edf93646579265cdb7021b82bc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6442, "upload_time": "2019-08-31T20:36:07", "url": "https://files.pythonhosted.org/packages/fb/62/5b608682da26436cf87faa2abd61fed15f0821b79df95027cf1eb28a556f/quart-compress-0.1.0.tar.gz" } ] }