{ "info": { "author": "better-requests", "author_email": "better-requests@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "# better-requests:
HTTP for Humans that do right\n\nA good design makes it intuitive and convenient to do right, \n**better-requests** is a wrapper for *requests* that makes default behaviors right. \n\n* Default value of timeout is 30s (configurable) instead of forever, no need to specify timeout explicitly everywhere. \n* Non-successful responses raise by default, no need to call raise_for_status explicitly everywhere. \n\n## Usage\n\nWrite this:\n\n``` python\n>>> import better_requests as requests\n>>> r = requests.get('https://www.python.org')\n>>> 'Python is a programming language' in r.content\nTrue\n```\n\nInstead of: \n\n``` python\n>>> import requests\n>>> \n>>> # You need to explicity specify timeout everywhere, or, BOOM!\n... r = requests.get('https://www.python.org', timeout=30)\n>>>\n>>> # And explicity check status_code before reading content, everywhere, or, BOOM!\n... r.raise_for_status()\n>>>\n>>> # And do things finally after all the ceremonies\n... 'Python is a programming language' in r.content\nTrue\n```\n\nWhen you need to configure default timeout, either set it globally: \n\n``` python\n>>> import better_requests as requests\n>>> requests.Session.default_timeout = 5\n>>>\n>>> r = requests.get('https://www.python.org')\n>>> 'Python is a programming language' in r.content\nTrue\n```\n\nOr per session:\n\n``` python\n>>> import better_requests as requests\n>>> with requests.Session() as s:\n>>> s.default_timeout = 5\n>>> s.get('https://httpbin.org/get')\n```\n\nIt works just as expected. \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/better-requests/better-requests", "keywords": "", "license": "Apache License v2", "maintainer": "", "maintainer_email": "", "name": "better-requests", "package_url": "https://pypi.org/project/better-requests/", "platform": "", "project_url": "https://pypi.org/project/better-requests/", "project_urls": { "Homepage": "https://github.com/better-requests/better-requests" }, "release_url": "https://pypi.org/project/better-requests/1.0.1/", "requires_dist": [ "requests (>=1.2.0)" ], "requires_python": "", "summary": "HTTP for Humans that do right", "version": "1.0.1" }, "last_serial": 5759006, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "0a2d173a89fa01c18f80a635ddfccb72", "sha256": "611939908b50b63adc771f0241f47793db2866c5a4832f94606f1a54189d39e0" }, "downloads": -1, "filename": "better_requests-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0a2d173a89fa01c18f80a635ddfccb72", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6344, "upload_time": "2019-08-30T08:21:59", "url": "https://files.pythonhosted.org/packages/1b/ef/5db1d787a250f0c853c8450527f4a24c702bddcc91d7418f0ec5a54b5ac2/better_requests-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0030199fd2e89ee0781c1060c452d4d", "sha256": "328abf6e2a424b115ec32f416b6ed814df967cbfaff23ced12d7c59371642cb9" }, "downloads": -1, "filename": "better-requests-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a0030199fd2e89ee0781c1060c452d4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4662, "upload_time": "2019-08-30T08:22:01", "url": "https://files.pythonhosted.org/packages/6a/08/49ddf6faefd3e7abafa7b188422f82e8666cb3224eb63ba3385e85ee721d/better-requests-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0a2d173a89fa01c18f80a635ddfccb72", "sha256": "611939908b50b63adc771f0241f47793db2866c5a4832f94606f1a54189d39e0" }, "downloads": -1, "filename": "better_requests-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0a2d173a89fa01c18f80a635ddfccb72", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6344, "upload_time": "2019-08-30T08:21:59", "url": "https://files.pythonhosted.org/packages/1b/ef/5db1d787a250f0c853c8450527f4a24c702bddcc91d7418f0ec5a54b5ac2/better_requests-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0030199fd2e89ee0781c1060c452d4d", "sha256": "328abf6e2a424b115ec32f416b6ed814df967cbfaff23ced12d7c59371642cb9" }, "downloads": -1, "filename": "better-requests-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a0030199fd2e89ee0781c1060c452d4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4662, "upload_time": "2019-08-30T08:22:01", "url": "https://files.pythonhosted.org/packages/6a/08/49ddf6faefd3e7abafa7b188422f82e8666cb3224eb63ba3385e85ee721d/better-requests-1.0.1.tar.gz" } ] }