{ "info": { "author": "Daniel Oaks, Chad Nelson", "author_email": "daniel@danieloaks.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP" ], "description": "===========\nHTTP Status\n===========\n\nA simple HTTP status code/name/description library for Python.\n\nUses the `six `__ library for Python 2/3 compatability.\n\n------------\nInstallation\n------------\n\nEither install via pip::\n\n $ pip install http_status\n\nOr clone the git repo, and run setup.py::\n\n $ git clone https://github.com/DanielOaks/http_status.git\n Cloning into 'http_status'...\n [...]\n Unpacking objects: 100% (18/18), done.\n\n $ cd http_status/\n\n $ python setup.py build install\n running build\n [...]\n Writing /usr/local/lib/python2.7/site-packages/http_status-0.1.0a-py2.7.egg-info\n\n-----\nUsage\n-----\n\nUse by itself::\n\n >>> import http_status\n >>> http_status.name[302]\n 'Found'\n >>> http_status.description[302]\n 'URI of this resource has changed, temporarily.'\n\nUse of the Status object::\n\n >>> from http_status import Status\n >>> s = Status(403)\n >>> s.code\n 403\n >>> s.name\n 'Forbidden'\n >>> s.description\n 'Client does not have rights to access the content.'\n\n >>> s.code = 405\n >>> s.name\n 'Method Not Allowed'\n >>> s.description\n 'Server has disabled this request method and cannot be used.'\n\n\nStatus() only accepts 'valid' HTTP status codes, ints from 100 to 599 as per RFC.\nIf an invalid code is given, it will throw an InvalidHttpCode exception::\n\n >>> from http_status import Status\n >>> s = Status(9999)\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"/usr/local/lib/python2.7/site-packages/http_status/__init__.py\", line 279, in __init__\n self.code = code\n File \"/usr/local/lib/python2.7/site-packages/http_status/__init__.py\", line 301, in code\n self._code = validate_http_code(http_code, strict=self.strict)\n File \"/usr/local/lib/python2.7/site-packages/http_status/__init__.py\", line 262, in validate_http_code\n raise InvalidHttpCode('{} is above maximum HTTP status code {}'.format(http_code, maximum))\n http_status.InvalidHttpCode: 9999 is above maximum HTTP status code 599\n\nHowever, it can be set to nonstrict to not throw exceptions, and simply return\nthe standard name/description not found for invalid objects, as such::\n\n >>> from http_status import Status\n >>> s = Status(9999, strict=False)\n >>> s\n \n >>> s.name\n 'No HTTP Name'\n >>> s.code\n 0\n\n\nNote that if the Status object does not have a name/description matching the\ngiven code, it will return default strings (for compatability when directly\ninserting ``Status.name`` and ``Status.description`` into format strings.\n\nThis can be changed by passing arguments ``name_fail`` and\n``description_fail`` when you create Status::\n\n >>> from http_status import Status\n >>> s = Status(243)\n >>> s.name\n 'No HTTP Name'\n >>> s.description\n 'No HTTP Description.'\n\n >>> from http_status import Status\n >>> s = Status(243, name_fail='Nothing', description_fail='Nothing at all')\n >>> s.name\n 'Nothing'\n >>> s.description\n 'Nothing at all'\n\nThe class ``NoneStatus`` is exactly the same as Status, but ``name_fail``\nand ``description_fail`` both default to None.\n\n-------\nSources\n-------\n\nDescriptions mostly adapted from:\n\n- Mozilla Dev Wiki: \n- Wikipedia: \n\n-------\nLicense\n-------\n\nCopyright (c) 2014 Daniel Oaks and contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n-------------------\nSix Library License\n-------------------\n\nCopyright (c) 2010-2014 Benjamin Peterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "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/DanielOaks/http_status", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "http-status", "package_url": "https://pypi.org/project/http-status/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/http-status/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/DanielOaks/http_status" }, "release_url": "https://pypi.org/project/http-status/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "HTTP Status codes, names, and descriptions.", "version": "1.0.0" }, "last_serial": 1308456, "releases": { "0.1.0a": [ { "comment_text": "", "digests": { "md5": "741b48a9f2d31e5c74b965e226df6a9d", "sha256": "032253b92e7f116925e9937ed1686da923e928eb0f52edbfef2cd51758d894da" }, "downloads": -1, "filename": "http-status-0.1.0a.tar.gz", "has_sig": false, "md5_digest": "741b48a9f2d31e5c74b965e226df6a9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4826, "upload_time": "2013-02-25T14:03:45", "url": "https://files.pythonhosted.org/packages/85/58/427427fffcee233b36414efe3cca5d1cf236a5e5f32a34302984ea4ef214/http-status-0.1.0a.tar.gz" } ], "0.2.0b": [ { "comment_text": "", "digests": { "md5": "b7469d53f013bd3628e0f28954f89cff", "sha256": "6de9bbccdd2385747890188d01bd57bb6d9afe788d23dacb0bbe0724a071215a" }, "downloads": -1, "filename": "http-status-0.2.0b.macosx-10.8-x86_64.exe", "has_sig": false, "md5_digest": "b7469d53f013bd3628e0f28954f89cff", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 82742, "upload_time": "2014-06-03T09:07:23", "url": "https://files.pythonhosted.org/packages/45/17/5edd82e909669dda6abef418439672b9acbcece1bbd55c39714a9e9b86ab/http-status-0.2.0b.macosx-10.8-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "bc199affc6beb85d0fc2369a48e85c3d", "sha256": "f219b5263090b98fb5140c1ea84d4bd112a30240c6ab4081a3cd35a8f7e667c7" }, "downloads": -1, "filename": "http-status-0.2.0b.tar.gz", "has_sig": false, "md5_digest": "bc199affc6beb85d0fc2369a48e85c3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13579, "upload_time": "2014-06-03T09:07:19", "url": "https://files.pythonhosted.org/packages/ac/15/56ab4d1d84cab1cb2fc4a972b48f477426357e443c3f8e893f0ebfca430b/http-status-0.2.0b.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "8cd6ce5605c67d5656ff4ed442b807b4", "sha256": "165ccf24e7d9081a7e4cb12fb0d89bfb3c46022edb4c71e1c3eaaf1b642f4dec" }, "downloads": -1, "filename": "http-status-1.0.0.macosx-10.8-x86_64.exe", "has_sig": false, "md5_digest": "8cd6ce5605c67d5656ff4ed442b807b4", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 82740, "upload_time": "2014-06-07T21:06:31", "url": "https://files.pythonhosted.org/packages/c2/a0/3f061fe1538942f90590b01bdac2773396f70dfa1d4237d43937c00ffaca/http-status-1.0.0.macosx-10.8-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "67613a9674a6a9e4ea5e7f53e649adcf", "sha256": "a20995fd560a4ca46f22fc37f8d551657b33e5fae2baa0976bcb6404aa5de9fa" }, "downloads": -1, "filename": "http-status-1.0.0.tar.gz", "has_sig": false, "md5_digest": "67613a9674a6a9e4ea5e7f53e649adcf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13729, "upload_time": "2014-06-07T21:06:20", "url": "https://files.pythonhosted.org/packages/ec/8c/5cab8324b77a4571d6b3335ab6d08c5b312d2b3ce25c95abc14762be4979/http-status-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8cd6ce5605c67d5656ff4ed442b807b4", "sha256": "165ccf24e7d9081a7e4cb12fb0d89bfb3c46022edb4c71e1c3eaaf1b642f4dec" }, "downloads": -1, "filename": "http-status-1.0.0.macosx-10.8-x86_64.exe", "has_sig": false, "md5_digest": "8cd6ce5605c67d5656ff4ed442b807b4", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 82740, "upload_time": "2014-06-07T21:06:31", "url": "https://files.pythonhosted.org/packages/c2/a0/3f061fe1538942f90590b01bdac2773396f70dfa1d4237d43937c00ffaca/http-status-1.0.0.macosx-10.8-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "67613a9674a6a9e4ea5e7f53e649adcf", "sha256": "a20995fd560a4ca46f22fc37f8d551657b33e5fae2baa0976bcb6404aa5de9fa" }, "downloads": -1, "filename": "http-status-1.0.0.tar.gz", "has_sig": false, "md5_digest": "67613a9674a6a9e4ea5e7f53e649adcf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13729, "upload_time": "2014-06-07T21:06:20", "url": "https://files.pythonhosted.org/packages/ec/8c/5cab8324b77a4571d6b3335ab6d08c5b312d2b3ce25c95abc14762be4979/http-status-1.0.0.tar.gz" } ] }