aiohttp-requests
============================================================
Behold, the power of aiohttp_ client with `Requests <http://docs.python-requests.org/>`_ simplicity:
.. code-block:: python
import asyncio
import aiohttp
from aiohttp_requests import requests
async def main():
response = await requests.get('https://api.github.com', auth=aiohttp.BasicAuth('user', 'password'))
text = await response.text()
json = await response.json()
return response, text, json
r, text, json = asyncio.run(main())
>>> r
<ClientResponse(https://api.github.com/) [200 OK]>
>>> r.status
200
>>> r.headers['Content-Type']
'application/json; charset=utf-8'
>>> r.get_encoding()
'utf-8'
>>> text
'{"current_user_url":"https://api.github.com/user",...'
>>> json
{'current_user_url': 'https://api.github.com/user', ... }
The `requests` object is just proxying `get` and other HTTP verb methods to `aiohttp.ClientSession`_, which returns `aiohttp.ClientResponse`_. To do anything else, read the aiohttp_ doc.
.. _`aiohttp.ClientSession`: https://docs.aiohttp.org/en/stable/client_reference.html?#aiohttp.ClientSession
.. _`aiohttp.ClientResponse`: https://docs.aiohttp.org/en/stable/client_reference.html?#aiohttp.ClientResponse
.. _aiohttp: https://docs.aiohttp.org/en/stable/
Links & Contact Info
====================
| PyPI Package: https://pypi.python.org/pypi/aiohttp-requests
| GitHub Source: https://github.com/maxzheng/aiohttp-requests
| Report Issues/Bugs: https://github.com/maxzheng/aiohttp-requests/issues
|
| Connect: https://www.linkedin.com/in/maxzheng
| Contact: maxzheng.os @t gmail.com
Raw data
{
"_id": null,
"home_page": "https://github.com/maxzheng/aiohttp-requests",
"name": "aiohttp-requests",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "aiohttp HTTP client async requests",
"author": "Max Zheng",
"author_email": "maxzheng.os @t gmail.com",
"download_url": "https://files.pythonhosted.org/packages/59/53/1fc7157455af25f8aeda07fdf288d3dcfdbdc4dc86c478472ccc39e18b20/aiohttp-requests-0.2.2.tar.gz",
"platform": null,
"description": "aiohttp-requests\n============================================================\n\nBehold, the power of aiohttp_ client with `Requests <http://docs.python-requests.org/>`_ simplicity:\n\n.. code-block:: python\n\n import asyncio\n\n import aiohttp\n from aiohttp_requests import requests\n\n async def main():\n response = await requests.get('https://api.github.com', auth=aiohttp.BasicAuth('user', 'password'))\n text = await response.text()\n json = await response.json()\n return response, text, json\n\n r, text, json = asyncio.run(main())\n\n >>> r\n <ClientResponse(https://api.github.com/) [200 OK]>\n >>> r.status\n 200\n >>> r.headers['Content-Type']\n 'application/json; charset=utf-8'\n >>> r.get_encoding()\n 'utf-8'\n >>> text\n '{\"current_user_url\":\"https://api.github.com/user\",...'\n >>> json\n {'current_user_url': 'https://api.github.com/user', ... }\n\nThe `requests` object is just proxying `get` and other HTTP verb methods to `aiohttp.ClientSession`_, which returns `aiohttp.ClientResponse`_. To do anything else, read the aiohttp_ doc.\n\n.. _`aiohttp.ClientSession`: https://docs.aiohttp.org/en/stable/client_reference.html?#aiohttp.ClientSession\n.. _`aiohttp.ClientResponse`: https://docs.aiohttp.org/en/stable/client_reference.html?#aiohttp.ClientResponse\n.. _aiohttp: https://docs.aiohttp.org/en/stable/\n\nLinks & Contact Info\n====================\n\n| PyPI Package: https://pypi.python.org/pypi/aiohttp-requests\n| GitHub Source: https://github.com/maxzheng/aiohttp-requests\n| Report Issues/Bugs: https://github.com/maxzheng/aiohttp-requests/issues\n|\n| Connect: https://www.linkedin.com/in/maxzheng\n| Contact: maxzheng.os @t gmail.com\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A thin wrapper for aiohttp client with Requests simplicity",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/maxzheng/aiohttp-requests"
},
"split_keywords": [
"aiohttp",
"http",
"client",
"async",
"requests"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d47afd7e64f20767bc2ab25207875cd44980826169088e114f3b8cb6de00e6ec",
"md5": "1ac5434c8cdeb30e06f20835b98dbbb4",
"sha256": "0328ba190fbe78d9568b3aecdc3970e29d8bbe1569aa6f3777dd1860b21a22ca"
},
"downloads": -1,
"filename": "aiohttp_requests-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1ac5434c8cdeb30e06f20835b98dbbb4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3779,
"upload_time": "2023-09-24T02:28:06",
"upload_time_iso_8601": "2023-09-24T02:28:06.256537Z",
"url": "https://files.pythonhosted.org/packages/d4/7a/fd7e64f20767bc2ab25207875cd44980826169088e114f3b8cb6de00e6ec/aiohttp_requests-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "59531fc7157455af25f8aeda07fdf288d3dcfdbdc4dc86c478472ccc39e18b20",
"md5": "35eba5e8e129217da120ff6415ffad4f",
"sha256": "7de563aa2e58d3249e85349bf00205c7d7f398f57457911c9d27520581419a02"
},
"downloads": -1,
"filename": "aiohttp-requests-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "35eba5e8e129217da120ff6415ffad4f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6399,
"upload_time": "2023-09-24T02:28:08",
"upload_time_iso_8601": "2023-09-24T02:28:08.050789Z",
"url": "https://files.pythonhosted.org/packages/59/53/1fc7157455af25f8aeda07fdf288d3dcfdbdc4dc86c478472ccc39e18b20/aiohttp-requests-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-24 02:28:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "maxzheng",
"github_project": "aiohttp-requests",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "aiohttp",
"specs": []
}
],
"tox": true,
"lcname": "aiohttp-requests"
}