METADATA 7.2 KB

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