{ "info": { "author": "P.J. Eby", "author_email": "web-sig@python.org", "bugtrack_url": null, "classifiers": [], "description": "Wouldn't it be nice if writing *correct* WSGI middleware was this simple?\n\n::\n\n >>> from wsgi_lite import lite, lighten\n \n >>> def latinator(app):\n ... \n ... # Make sure that `app` can be invoked via the Lite protocol, even\n ... # if it's a standard WSGI 1 app:\n ... app = lighten(app) \n ... \n ... @lite\n ... def middleware(environ):\n ... status, headers, body = app(environ)\n ... for name, value in headers:\n ... if name.lower()=='content-type' and value=='text/plain':\n ... break\n ... else:\n ... # Not text/plain, pass the request through unchanged \n ... return status, headers, body\n ... \n ... # Strip content-length if present, else it'll be wrong\n ... headers = [\n ... (name, value) for name, value in headers\n ... if name.lower() != 'content-length'\n ... ]\n ... return status, headers, (piglatin(data) for data in body)\n ... \n ... return middleware\n\nUsing just two decorators, WSGI Lite lets you create correct and compliant\nmiddleware and applications, without needing to worry about ``start_response``,\n``write`` and ``close`` calls. And with those *same* two decorators, it also\nlets you manage resources to be released at the end of a request, and\nautomatically pass in keyword arguments to your apps or middleware that\nare obtained from the WSGI environment (like WSGI server extensions or\nmiddleware-supplied parameters such as request or session objects).\n\nFor more details, check out the `project's home page on BitBucket\n`_, and scroll down to the\ntable of contents.\n\nWSGI Lite is currently only available for Python 2.x (tested w/2.3 up to 2.7)\nbut the source should be quite portable to 3.x, as its magic is limited to\ninspecting function argument names, and cloning functions using\n``new.function()``. \n\n.. _toc:", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/pje/wsgi_lite/get/default.tar.gz#egg=wsgi_lite-dev", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/pje/wsgi_lite/", "keywords": null, "license": "ASF", "maintainer": null, "maintainer_email": null, "name": "wsgi_lite", "package_url": "https://pypi.org/project/wsgi_lite/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wsgi_lite/", "project_urls": { "Download": "https://bitbucket.org/pje/wsgi_lite/get/default.tar.gz#egg=wsgi_lite-dev", "Homepage": "https://bitbucket.org/pje/wsgi_lite/" }, "release_url": "https://pypi.org/project/wsgi_lite/0.5a3-1/", "requires_dist": null, "requires_python": null, "summary": "A better way to write WSGI apps and middleware", "version": "0.5a3-1" }, "last_serial": 938506, "releases": { "0.5a1": [ { "comment_text": "", "digests": { "md5": "c465cefc9f660ea36a64c0138f17eaa5", "sha256": "45f55e9edecfb84f3b80f2685aea826c6ce98658b5e74a9d62b142a045ef9f3b" }, "downloads": -1, "filename": "wsgi_lite-0.5a1.tar.gz", "has_sig": false, "md5_digest": "c465cefc9f660ea36a64c0138f17eaa5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22125, "upload_time": "2011-08-01T02:51:56", "url": "https://files.pythonhosted.org/packages/c7/0d/ae490d8c35be2942e5122c3ac8d04af9540b0f4ff2e3bf4135593c65d834/wsgi_lite-0.5a1.tar.gz" } ], "0.5a2": [ { "comment_text": "", "digests": { "md5": "ab89931a2b8c515349beb995a5f7d636", "sha256": "aa087a914d36667c6d376683e398b8a1ddf2138231c37a55eed5d14b66c346fb" }, "downloads": -1, "filename": "wsgi_lite-0.5a2.tar.gz", "has_sig": false, "md5_digest": "ab89931a2b8c515349beb995a5f7d636", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22137, "upload_time": "2011-08-02T16:45:25", "url": "https://files.pythonhosted.org/packages/f6/f8/b8314bd5dfcac29d3e8aec11144f0b37ded275b4cdc72e160e8d3d1afc61/wsgi_lite-0.5a2.tar.gz" } ], "0.5a3": [ { "comment_text": "", "digests": { "md5": "2ef101049cb1f9339c67d5eb95df38b5", "sha256": "ae2c40e1498ecbf6e08e0913f95d5d42ef7e533dac1ab463255a28bd568f98b7" }, "downloads": -1, "filename": "wsgi_lite-0.5a3.tar.gz", "has_sig": false, "md5_digest": "2ef101049cb1f9339c67d5eb95df38b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6901, "upload_time": "2013-12-04T16:47:41", "url": "https://files.pythonhosted.org/packages/8a/b2/448c28192b7c6916818f0faf999ec780daeb69a2c28018bd0a407367edaf/wsgi_lite-0.5a3.tar.gz" } ], "0.5a3-1": [ { "comment_text": "", "digests": { "md5": "c23df137ac1036eb45d9e7a2d21a01c1", "sha256": "a29a835cfc52bab11959e8d8104a94b6be33403d118c04533ea764407b7fa960" }, "downloads": -1, "filename": "wsgi_lite-0.5a3-1.tar.gz", "has_sig": false, "md5_digest": "c23df137ac1036eb45d9e7a2d21a01c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26767, "upload_time": "2013-12-07T19:48:05", "url": "https://files.pythonhosted.org/packages/80/ca/f3b3ff345a5981555d6d80bffd6f04ebfc77768cc65a057f51a6e702d7fe/wsgi_lite-0.5a3-1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c23df137ac1036eb45d9e7a2d21a01c1", "sha256": "a29a835cfc52bab11959e8d8104a94b6be33403d118c04533ea764407b7fa960" }, "downloads": -1, "filename": "wsgi_lite-0.5a3-1.tar.gz", "has_sig": false, "md5_digest": "c23df137ac1036eb45d9e7a2d21a01c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26767, "upload_time": "2013-12-07T19:48:05", "url": "https://files.pythonhosted.org/packages/80/ca/f3b3ff345a5981555d6d80bffd6f04ebfc77768cc65a057f51a6e702d7fe/wsgi_lite-0.5a3-1.tar.gz" } ] }