METADATA 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. Metadata-Version: 2.4
  2. Name: aiohttp
  3. Version: 3.11.16
  4. Summary: Async http client/server framework (asyncio)
  5. Home-page: https://github.com/aio-libs/aiohttp
  6. Maintainer: aiohttp team <team@aiohttp.org>
  7. Maintainer-email: team@aiohttp.org
  8. License: Apache-2.0
  9. Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org
  10. Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org
  11. Project-URL: CI: GitHub Actions, https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI
  12. Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/aiohttp
  13. Project-URL: Docs: Changelog, https://docs.aiohttp.org/en/stable/changes.html
  14. Project-URL: Docs: RTD, https://docs.aiohttp.org
  15. Project-URL: GitHub: issues, https://github.com/aio-libs/aiohttp/issues
  16. Project-URL: GitHub: repo, https://github.com/aio-libs/aiohttp
  17. Classifier: Development Status :: 5 - Production/Stable
  18. Classifier: Framework :: AsyncIO
  19. Classifier: Intended Audience :: Developers
  20. Classifier: License :: OSI Approved :: Apache Software License
  21. Classifier: Operating System :: POSIX
  22. Classifier: Operating System :: MacOS :: MacOS X
  23. Classifier: Operating System :: Microsoft :: Windows
  24. Classifier: Programming Language :: Python
  25. Classifier: Programming Language :: Python :: 3
  26. Classifier: Programming Language :: Python :: 3.9
  27. Classifier: Programming Language :: Python :: 3.10
  28. Classifier: Programming Language :: Python :: 3.11
  29. Classifier: Programming Language :: Python :: 3.12
  30. Classifier: Programming Language :: Python :: 3.13
  31. Classifier: Topic :: Internet :: WWW/HTTP
  32. Requires-Python: >=3.9
  33. Description-Content-Type: text/x-rst
  34. License-File: LICENSE.txt
  35. Requires-Dist: aiohappyeyeballs>=2.3.0
  36. Requires-Dist: aiosignal>=1.1.2
  37. Requires-Dist: async-timeout<6.0,>=4.0; python_version < "3.11"
  38. Requires-Dist: attrs>=17.3.0
  39. Requires-Dist: frozenlist>=1.1.1
  40. Requires-Dist: multidict<7.0,>=4.5
  41. Requires-Dist: propcache>=0.2.0
  42. Requires-Dist: yarl<2.0,>=1.17.0
  43. Provides-Extra: speedups
  44. Requires-Dist: aiodns>=3.2.0; (sys_platform == "linux" or sys_platform == "darwin") and extra == "speedups"
  45. Requires-Dist: Brotli; platform_python_implementation == "CPython" and extra == "speedups"
  46. Requires-Dist: brotlicffi; platform_python_implementation != "CPython" and extra == "speedups"
  47. Dynamic: license-file
  48. ==================================
  49. Async http client/server framework
  50. ==================================
  51. .. image:: https://raw.githubusercontent.com/aio-libs/aiohttp/master/docs/aiohttp-plain.svg
  52. :height: 64px
  53. :width: 64px
  54. :alt: aiohttp logo
  55. |
  56. .. image:: https://github.com/aio-libs/aiohttp/workflows/CI/badge.svg
  57. :target: https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI
  58. :alt: GitHub Actions status for master branch
  59. .. image:: https://codecov.io/gh/aio-libs/aiohttp/branch/master/graph/badge.svg
  60. :target: https://codecov.io/gh/aio-libs/aiohttp
  61. :alt: codecov.io status for master branch
  62. .. image:: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json
  63. :target: https://codspeed.io/aio-libs/aiohttp
  64. :alt: Codspeed.io status for aiohttp
  65. .. image:: https://badge.fury.io/py/aiohttp.svg
  66. :target: https://pypi.org/project/aiohttp
  67. :alt: Latest PyPI package version
  68. .. image:: https://readthedocs.org/projects/aiohttp/badge/?version=latest
  69. :target: https://docs.aiohttp.org/
  70. :alt: Latest Read The Docs
  71. .. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
  72. :target: https://matrix.to/#/%23aio-libs:matrix.org
  73. :alt: Matrix Room — #aio-libs:matrix.org
  74. .. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
  75. :target: https://matrix.to/#/%23aio-libs-space:matrix.org
  76. :alt: Matrix Space — #aio-libs-space:matrix.org
  77. Key Features
  78. ============
  79. - Supports both client and server side of HTTP protocol.
  80. - Supports both client and server Web-Sockets out-of-the-box and avoids
  81. Callback Hell.
  82. - Provides Web-server with middleware and pluggable routing.
  83. Getting started
  84. ===============
  85. Client
  86. ------
  87. To get something from the web:
  88. .. code-block:: python
  89. import aiohttp
  90. import asyncio
  91. async def main():
  92. async with aiohttp.ClientSession() as session:
  93. async with session.get('http://python.org') as response:
  94. print("Status:", response.status)
  95. print("Content-type:", response.headers['content-type'])
  96. html = await response.text()
  97. print("Body:", html[:15], "...")
  98. asyncio.run(main())
  99. This prints:
  100. .. code-block::
  101. Status: 200
  102. Content-type: text/html; charset=utf-8
  103. Body: <!doctype html> ...
  104. Coming from `requests <https://requests.readthedocs.io/>`_ ? Read `why we need so many lines <https://aiohttp.readthedocs.io/en/latest/http_request_lifecycle.html>`_.
  105. Server
  106. ------
  107. An example using a simple server:
  108. .. code-block:: python
  109. # examples/server_simple.py
  110. from aiohttp import web
  111. async def handle(request):
  112. name = request.match_info.get('name', "Anonymous")
  113. text = "Hello, " + name
  114. return web.Response(text=text)
  115. async def wshandle(request):
  116. ws = web.WebSocketResponse()
  117. await ws.prepare(request)
  118. async for msg in ws:
  119. if msg.type == web.WSMsgType.text:
  120. await ws.send_str("Hello, {}".format(msg.data))
  121. elif msg.type == web.WSMsgType.binary:
  122. await ws.send_bytes(msg.data)
  123. elif msg.type == web.WSMsgType.close:
  124. break
  125. return ws
  126. app = web.Application()
  127. app.add_routes([web.get('/', handle),
  128. web.get('/echo', wshandle),
  129. web.get('/{name}', handle)])
  130. if __name__ == '__main__':
  131. web.run_app(app)
  132. Documentation
  133. =============
  134. https://aiohttp.readthedocs.io/
  135. Demos
  136. =====
  137. https://github.com/aio-libs/aiohttp-demos
  138. External links
  139. ==============
  140. * `Third party libraries
  141. <http://aiohttp.readthedocs.io/en/latest/third_party.html>`_
  142. * `Built with aiohttp
  143. <http://aiohttp.readthedocs.io/en/latest/built_with.html>`_
  144. * `Powered by aiohttp
  145. <http://aiohttp.readthedocs.io/en/latest/powered_by.html>`_
  146. Feel free to make a Pull Request for adding your link to these pages!
  147. Communication channels
  148. ======================
  149. *aio-libs Discussions*: https://github.com/aio-libs/aiohttp/discussions
  150. *Matrix*: `#aio-libs:matrix.org <https://matrix.to/#/#aio-libs:matrix.org>`_
  151. We support `Stack Overflow
  152. <https://stackoverflow.com/questions/tagged/aiohttp>`_.
  153. Please add *aiohttp* tag to your question there.
  154. Requirements
  155. ============
  156. - attrs_
  157. - multidict_
  158. - yarl_
  159. - frozenlist_
  160. Optionally you may install the aiodns_ library (highly recommended for sake of speed).
  161. .. _aiodns: https://pypi.python.org/pypi/aiodns
  162. .. _attrs: https://github.com/python-attrs/attrs
  163. .. _multidict: https://pypi.python.org/pypi/multidict
  164. .. _frozenlist: https://pypi.org/project/frozenlist/
  165. .. _yarl: https://pypi.python.org/pypi/yarl
  166. .. _async-timeout: https://pypi.python.org/pypi/async_timeout
  167. License
  168. =======
  169. ``aiohttp`` is offered under the Apache 2 license.
  170. Keepsafe
  171. ========
  172. The aiohttp community would like to thank Keepsafe
  173. (https://www.getkeepsafe.com) for its support in the early days of
  174. the project.
  175. Source code
  176. ===========
  177. The latest developer version is available in a GitHub repository:
  178. https://github.com/aio-libs/aiohttp
  179. Benchmarks
  180. ==========
  181. If you are interested in efficiency, the AsyncIO community maintains a
  182. list of benchmarks on the official wiki:
  183. https://github.com/python/asyncio/wiki/Benchmarks