METADATA 7.3 KB

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