{ "info": { "author": "Sam Brauer", "author_email": "sam.brauer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware" ], "description": "print_json_middleware\n=====================\n\nJSON prettyprinter WSGI middleware\n\nHandy for viewing JSON payloads which would otherwise be downloaded by your web browser (due to the Content-Type response header being set to an unrecognized type like \"application/json\").\n\nIf a special query parameter (by default \"pj\", short for \"Print JSON\") is found in the query string, assume the response body contains JSON data which should be \"printed\" to the response by setting the response Content-Type to \"text/plain\".\n\nExample usage::\n\n http://foo.org/some/json?pj\n\nIf the parameter has a positive integer value, prettyprint the JSON (sort the keys and treat the parm value as an indent value).\n\nExample usage::\n\n http://foo.org/some/json?pj=2\n\nNote that the parameter is removed from the request query string before the middleware invokes the wrapped application.\n\nSetup\n-----\n\nIf using Paster, edit your .ini file and add a new filter section::\n\n [filter:print_json]\n use = egg:print_json_middleware#print_json\n\nThen find the application section (typically under the header ``[app:main]``) and add::\n\n filter-with = print_json\n\nIf you'd rather use some other parameter name than \"pj\", specify it in the ``[filter:print_json]`` section::\n\n parm = whatever\n\nAs an alternative to Paster configuration, you could do the application wrapping in Python code::\n\n from print_json_middleware import PrintJsonMiddleware\n application = PrintJsonMiddleware(application)\n\nIf you'd rather use some other parameter name than \"pj\", pass it as a second argument::\n\n application = PrintJsonMiddleware(application, \"whatever\")", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sbrauer/print_json_middleware", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "print_json_middleware", "package_url": "https://pypi.org/project/print_json_middleware/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/print_json_middleware/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sbrauer/print_json_middleware" }, "release_url": "https://pypi.org/project/print_json_middleware/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "JSON prettyprinter WSGI middleware", "version": "0.1.1" }, "last_serial": 796686, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "498ab9e580a6d90a38717af9ca545f76", "sha256": "ba38be0b9a4b32397df13201172f05e6c83ad50b77abb3c7620d37852168e86d" }, "downloads": -1, "filename": "print_json_middleware-0.1.1.tar.gz", "has_sig": false, "md5_digest": "498ab9e580a6d90a38717af9ca545f76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3434, "upload_time": "2013-03-21T13:33:32", "url": "https://files.pythonhosted.org/packages/da/67/3dfc262d13818b221c86f9ad775a01f822ba0cbef5a2c7e3d9448f3951d4/print_json_middleware-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "498ab9e580a6d90a38717af9ca545f76", "sha256": "ba38be0b9a4b32397df13201172f05e6c83ad50b77abb3c7620d37852168e86d" }, "downloads": -1, "filename": "print_json_middleware-0.1.1.tar.gz", "has_sig": false, "md5_digest": "498ab9e580a6d90a38717af9ca545f76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3434, "upload_time": "2013-03-21T13:33:32", "url": "https://files.pythonhosted.org/packages/da/67/3dfc262d13818b221c86f9ad775a01f822ba0cbef5a2c7e3d9448f3951d4/print_json_middleware-0.1.1.tar.gz" } ] }