{ "info": { "author": "Suby Raman", "author_email": "", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: WWW/HTTP :: Session" ], "description": "sanic\\_compress\n===============\n\nsanic\\_compress is an extension which allows you to easily gzip your\nSanic responses. It is a port of the\n`Flask-Compress `__\nextension.\n\nInstallation\n------------\n\nInstall with ``pip``:\n\n``pip install sanic_compress``\n\nUsage\n-----\n\nUsage is simple. Simply pass in the Sanic app object to the ``Compress``\nclass, and responses will be gzipped.\n\n.. code:: python\n\n from sanic import Sanic\n from sanic_compress import Compress\n\n app = Sanic(__name__)\n Compress(app)\n\nAlternatively, if you want to initialize the ``Compress`` class later,\nyou can do so with the ``init_app`` method;\n\n.. code:: python\n\n compress = Compress()\n app = Flask(__name__)\n compress.init_app(app)\n\nOptions\n-------\n\nWithin the Sanic application config you can provide the following\nsettings to control the behavior of sanic\\_compress. None of the\nsettings are required.\n\n``COMPRESS_MIMETYPES``: Set the list of mimetypes to compress here. -\nDefault:\n``['text/html','text/css','text/xml','application/json','application/javascript']``\n\n``COMPRESS_LEVEL``: Specifies the gzip compression level (1-9). -\nDefault: ``6``\n\n``COMPRESS_MIN_SIZE``: Specifies the minimum size (in bytes) threshold\nfor compressing responses. - Default: ``500``\n\nA higher ``COMPRESS_LEVEL`` will result in a gzipped response that is\nsmaller, but the compression will take longer.\n\nExample of using custom configuration:\n\n.. code:: python\n\n from sanic import Sanic\n from sanic_compress import Compress\n\n app = Sanic(__name__)\n app.config['COMPRESS_MIMETYPES'] = set(['text/html', 'application/json'])\n app.config['COMPRESS_LEVEL'] = 4\n app.config['COMPRESS_MIN_SIZE'] = 300\n Compress(app)\n\nNote about gzipping static files:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSanic is not at heart a file server. You should consider serving static\nfiles with nginx or on a separate file server.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/subyraman/sanic_session", "keywords": "sanic", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sanic_compress", "package_url": "https://pypi.org/project/sanic_compress/", "platform": "", "project_url": "https://pypi.org/project/sanic_compress/", "project_urls": { "Homepage": "http://github.com/subyraman/sanic_session" }, "release_url": "https://pypi.org/project/sanic_compress/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "An extension which allows you to easily gzip your Sanic responses.", "version": "0.1.1" }, "last_serial": 2652292, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f4bf96e4f080830e6c891887c7bff99f", "sha256": "a3e8e0bf121b29d43763e8d49117fe892d1de6f3c4a187642f8ae572706e9457" }, "downloads": -1, "filename": "sanic_compress-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f4bf96e4f080830e6c891887c7bff99f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2731, "upload_time": "2017-02-19T00:26:04", "url": "https://files.pythonhosted.org/packages/24/58/c5604e3f4664483bcfbfb6b691df7746ec3abe60f93c06e1dbe9464d7637/sanic_compress-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6b40438ddc77c1a998bb7c5277e1f7aa", "sha256": "350123350caad62a6815f70b485fd98b6c3e94c1cdaefc4a192d3075d540522b" }, "downloads": -1, "filename": "sanic_compress-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6b40438ddc77c1a998bb7c5277e1f7aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2517, "upload_time": "2017-02-19T00:44:59", "url": "https://files.pythonhosted.org/packages/4c/76/285235ef1755b75936bb16b5f9424b7ac60af8949f865fea63287b863cef/sanic_compress-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6b40438ddc77c1a998bb7c5277e1f7aa", "sha256": "350123350caad62a6815f70b485fd98b6c3e94c1cdaefc4a192d3075d540522b" }, "downloads": -1, "filename": "sanic_compress-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6b40438ddc77c1a998bb7c5277e1f7aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2517, "upload_time": "2017-02-19T00:44:59", "url": "https://files.pythonhosted.org/packages/4c/76/285235ef1755b75936bb16b5f9424b7ac60af8949f865fea63287b863cef/sanic_compress-0.1.1.tar.gz" } ] }