METADATA 7.2 KB

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