You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

433 lines
17 KiB

4 years ago
  1. Metadata-Version: 2.1
  2. Name: aiohttp
  3. Version: 3.5.4
  4. Summary: Async http client/server framework (asyncio)
  5. Home-page: https://github.com/aio-libs/aiohttp
  6. Author: Nikolay Kim
  7. Author-email: fafhrd91@gmail.com
  8. Maintainer: Nikolay Kim <fafhrd91@gmail.com>, Andrew Svetlov <andrew.svetlov@gmail.com>
  9. Maintainer-email: aio-libs@googlegroups.com
  10. License: Apache 2
  11. Project-URL: CI: Travis, https://travis-ci.com/aio-libs/aiohttp
  12. Project-URL: CI: Circle, https://circleci.com/gh/aio-libs/aiohttp
  13. Project-URL: CI: Shippable, https://app.shippable.com/github/aio-libs/aiohttp
  14. Project-URL: GitHub: issues, https://github.com/aio-libs/aiohttp/issues
  15. Project-URL: Docs: RTD, https://docs.aiohttp.org
  16. Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/aiohttp
  17. Project-URL: CI: AppVeyor, https://ci.appveyor.com/project/aio-libs/aiohttp
  18. Project-URL: GitHub: repo, https://github.com/aio-libs/aiohttp
  19. Project-URL: Chat: Gitter, https://gitter.im/aio-libs/Lobby
  20. Platform: UNKNOWN
  21. Classifier: License :: OSI Approved :: Apache Software License
  22. Classifier: Intended Audience :: Developers
  23. Classifier: Programming Language :: Python
  24. Classifier: Programming Language :: Python :: 3
  25. Classifier: Programming Language :: Python :: 3.5
  26. Classifier: Programming Language :: Python :: 3.6
  27. Classifier: Programming Language :: Python :: 3.7
  28. Classifier: Development Status :: 5 - Production/Stable
  29. Classifier: Operating System :: POSIX
  30. Classifier: Operating System :: MacOS :: MacOS X
  31. Classifier: Operating System :: Microsoft :: Windows
  32. Classifier: Topic :: Internet :: WWW/HTTP
  33. Classifier: Framework :: AsyncIO
  34. Requires-Python: >=3.5.3
  35. Requires-Dist: attrs (>=17.3.0)
  36. Requires-Dist: chardet (<4.0,>=2.0)
  37. Requires-Dist: multidict (<5.0,>=4.0)
  38. Requires-Dist: async-timeout (<4.0,>=3.0)
  39. Requires-Dist: yarl (<2.0,>=1.0)
  40. Requires-Dist: idna-ssl (>=1.0) ; python_version < "3.7"
  41. Requires-Dist: typing-extensions (>=3.6.5) ; python_version < "3.7"
  42. Provides-Extra: speedups
  43. Requires-Dist: aiodns ; extra == 'speedups'
  44. Requires-Dist: brotlipy ; extra == 'speedups'
  45. Requires-Dist: cchardet ; extra == 'speedups'
  46. ==================================
  47. Async http client/server framework
  48. ==================================
  49. .. image:: https://raw.githubusercontent.com/aio-libs/aiohttp/master/docs/_static/aiohttp-icon-128x128.png
  50. :height: 64px
  51. :width: 64px
  52. :alt: aiohttp logo
  53. |
  54. .. image:: https://travis-ci.com/aio-libs/aiohttp.svg?branch=master
  55. :target: https://travis-ci.com/aio-libs/aiohttp
  56. :align: right
  57. :alt: Travis status for master branch
  58. .. image:: https://ci.appveyor.com/api/projects/status/tnddy9k6pphl8w7k/branch/master?svg=true
  59. :target: https://ci.appveyor.com/project/aio-libs/aiohttp
  60. :align: right
  61. :alt: AppVeyor status for master branch
  62. .. image:: https://codecov.io/gh/aio-libs/aiohttp/branch/master/graph/badge.svg
  63. :target: https://codecov.io/gh/aio-libs/aiohttp
  64. :alt: codecov.io status for master branch
  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://badges.gitter.im/Join%20Chat.svg
  72. :target: https://gitter.im/aio-libs/Lobby
  73. :alt: Chat on Gitter
  74. Key Features
  75. ============
  76. - Supports both client and server side of HTTP protocol.
  77. - Supports both client and server Web-Sockets out-of-the-box and avoids
  78. Callback Hell.
  79. - Provides Web-server with middlewares and pluggable routing.
  80. Getting started
  81. ===============
  82. Client
  83. ------
  84. To get something from the web:
  85. .. code-block:: python
  86. import aiohttp
  87. import asyncio
  88. async def fetch(session, url):
  89. async with session.get(url) as response:
  90. return await response.text()
  91. async def main():
  92. async with aiohttp.ClientSession() as session:
  93. html = await fetch(session, 'http://python.org')
  94. print(html)
  95. if __name__ == '__main__':
  96. loop = asyncio.get_event_loop()
  97. loop.run_until_complete(main())
  98. Server
  99. ------
  100. An example using a simple server:
  101. .. code-block:: python
  102. # examples/server_simple.py
  103. from aiohttp import web
  104. async def handle(request):
  105. name = request.match_info.get('name', "Anonymous")
  106. text = "Hello, " + name
  107. return web.Response(text=text)
  108. async def wshandle(request):
  109. ws = web.WebSocketResponse()
  110. await ws.prepare(request)
  111. async for msg in ws:
  112. if msg.type == web.WSMsgType.text:
  113. await ws.send_str("Hello, {}".format(msg.data))
  114. elif msg.type == web.WSMsgType.binary:
  115. await ws.send_bytes(msg.data)
  116. elif msg.type == web.WSMsgType.close:
  117. break
  118. return ws
  119. app = web.Application()
  120. app.add_routes([web.get('/', handle),
  121. web.get('/echo', wshandle),
  122. web.get('/{name}', handle)])
  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* google group: https://groups.google.com/forum/#!forum/aio-libs
  142. Feel free to post your questions and ideas here.
  143. *gitter chat* https://gitter.im/aio-libs/Lobby
  144. We support `Stack Overflow
  145. <https://stackoverflow.com/questions/tagged/aiohttp>`_.
  146. Please add *aiohttp* tag to your question there.
  147. Requirements
  148. ============
  149. - Python >= 3.5.3
  150. - async-timeout_
  151. - attrs_
  152. - chardet_
  153. - multidict_
  154. - yarl_
  155. Optionally you may install the cChardet_ and aiodns_ libraries (highly
  156. recommended for sake of speed).
  157. .. _chardet: https://pypi.python.org/pypi/chardet
  158. .. _aiodns: https://pypi.python.org/pypi/aiodns
  159. .. _attrs: https://github.com/python-attrs/attrs
  160. .. _multidict: https://pypi.python.org/pypi/multidict
  161. .. _yarl: https://pypi.python.org/pypi/yarl
  162. .. _async-timeout: https://pypi.python.org/pypi/async_timeout
  163. .. _cChardet: https://pypi.python.org/pypi/cchardet
  164. License
  165. =======
  166. ``aiohttp`` is offered under the Apache 2 license.
  167. Keepsafe
  168. ========
  169. The aiohttp community would like to thank Keepsafe
  170. (https://www.getkeepsafe.com) for its support in the early days of
  171. the project.
  172. Source code
  173. ===========
  174. The latest developer version is available in a GitHub repository:
  175. https://github.com/aio-libs/aiohttp
  176. Benchmarks
  177. ==========
  178. If you are interested in efficiency, the AsyncIO community maintains a
  179. list of benchmarks on the official wiki:
  180. https://github.com/python/asyncio/wiki/Benchmarks
  181. =========
  182. Changelog
  183. =========
  184. ..
  185. You should *NOT* be adding new change log entries to this file, this
  186. file is managed by towncrier. You *may* edit previous change logs to
  187. fix problems like typo corrections or such.
  188. To add a new change log entry, please see
  189. https://pip.pypa.io/en/latest/development/#adding-a-news-entry
  190. we named the news folder "changes".
  191. WARNING: Don't drop the next directive!
  192. .. towncrier release notes start
  193. 3.5.4 (2019-01-12)
  194. ==================
  195. Bugfixes
  196. --------
  197. - Fix stream ``.read()`` / ``.readany()`` / ``.iter_any()`` which used to return a
  198. partial content only in case of compressed content
  199. `#3525 <https://github.com/aio-libs/aiohttp/issues/3525>`_
  200. 3.5.3 (2019-01-10)
  201. ==================
  202. Bugfixes
  203. --------
  204. - Fix type stubs for ``aiohttp.web.run_app(access_log=True)`` and fix edge case of ``access_log=True`` and the event loop being in debug mode.
  205. `#3504 <https://github.com/aio-libs/aiohttp/issues/3504>`_
  206. - Fix ``aiohttp.ClientTimeout`` type annotations to accept ``None`` for fields
  207. `#3511 <https://github.com/aio-libs/aiohttp/issues/3511>`_
  208. - Send custom per-request cookies even if session jar is empty
  209. `#3515 <https://github.com/aio-libs/aiohttp/issues/3515>`_
  210. - Restore Linux binary wheels publishing on PyPI
  211. ----
  212. 3.5.2 (2019-01-08)
  213. ==================
  214. Features
  215. --------
  216. - ``FileResponse`` from ``web_fileresponse.py`` uses a ``ThreadPoolExecutor`` to work with files asynchronously.
  217. I/O based payloads from ``payload.py`` uses a ``ThreadPoolExecutor`` to work with I/O objects asynchronously.
  218. `#3313 <https://github.com/aio-libs/aiohttp/issues/3313>`_
  219. - Internal Server Errors in plain text if the browser does not support HTML.
  220. `#3483 <https://github.com/aio-libs/aiohttp/issues/3483>`_
  221. Bugfixes
  222. --------
  223. - Preserve MultipartWriter parts headers on write.
  224. Refactor the way how ``Payload.headers`` are handled. Payload instances now always
  225. have headers and Content-Type defined.
  226. Fix Payload Content-Disposition header reset after initial creation.
  227. `#3035 <https://github.com/aio-libs/aiohttp/issues/3035>`_
  228. - Log suppressed exceptions in ``GunicornWebWorker``.
  229. `#3464 <https://github.com/aio-libs/aiohttp/issues/3464>`_
  230. - Remove wildcard imports.
  231. `#3468 <https://github.com/aio-libs/aiohttp/issues/3468>`_
  232. - Use the same task for app initialization and web server handling in gunicorn workers.
  233. It allows to use Python3.7 context vars smoothly.
  234. `#3471 <https://github.com/aio-libs/aiohttp/issues/3471>`_
  235. - Fix handling of chunked+gzipped response when first chunk does not give uncompressed data
  236. `#3477 <https://github.com/aio-libs/aiohttp/issues/3477>`_
  237. - Replace ``collections.MutableMapping`` with ``collections.abc.MutableMapping`` to avoid a deprecation warning.
  238. `#3480 <https://github.com/aio-libs/aiohttp/issues/3480>`_
  239. - ``Payload.size`` type annotation changed from `Optional[float]` to `Optional[int]`.
  240. `#3484 <https://github.com/aio-libs/aiohttp/issues/3484>`_
  241. - Ignore done tasks when cancels pending activities on ``web.run_app`` finalization.
  242. `#3497 <https://github.com/aio-libs/aiohttp/issues/3497>`_
  243. Improved Documentation
  244. ----------------------
  245. - Add documentation for ``aiohttp.web.HTTPException``.
  246. `#3490 <https://github.com/aio-libs/aiohttp/issues/3490>`_
  247. Misc
  248. ----
  249. - `#3487 <https://github.com/aio-libs/aiohttp/issues/3487>`_
  250. ----
  251. 3.5.1 (2018-12-24)
  252. ====================
  253. - Fix a regression about ``ClientSession._requote_redirect_url`` modification in debug
  254. mode.
  255. 3.5.0 (2018-12-22)
  256. ====================
  257. Features
  258. --------
  259. - The library type annotations are checked in strict mode now.
  260. - Add support for setting cookies for individual request (`#2387 <https://github.com/aio-libs/aiohttp/pull/2387>`_)
  261. - Application.add_domain implementation (`#2809 <https://github.com/aio-libs/aiohttp/pull/2809>`_)
  262. - The default ``app`` in the request returned by ``test_utils.make_mocked_request``
  263. can now have objects assigned to it and retrieved using the ``[]`` operator. (`#3174 <https://github.com/aio-libs/aiohttp/pull/3174>`_)
  264. - Make ``request.url`` accessible when transport is closed. (`#3177 <https://github.com/aio-libs/aiohttp/pull/3177>`_)
  265. - Add ``zlib_executor_size`` argument to ``Response`` constructor to allow compression to run in a background executor to avoid blocking the main thread and potentially triggering health check failures. (`#3205 <https://github.com/aio-libs/aiohttp/pull/3205>`_)
  266. - Enable users to set `ClientTimeout` in `aiohttp.request` (`#3213 <https://github.com/aio-libs/aiohttp/pull/3213>`_)
  267. - Don't raise a warning if ``NETRC`` environment variable is not set and ``~/.netrc`` file
  268. doesn't exist. (`#3267 <https://github.com/aio-libs/aiohttp/pull/3267>`_)
  269. - Add default logging handler to web.run_app
  270. If the `Application.debug` flag is set and the default logger `aiohttp.access` is used, access logs will now be output using a `stderr` `StreamHandler` if no handlers are attached. Furthermore, if the default logger has no log level set, the log level will be set to `DEBUG`. (`#3324 <https://github.com/aio-libs/aiohttp/pull/3324>`_)
  271. - Add method argument to ``session.ws_connect()``.
  272. Sometimes server API requires a different HTTP method for WebSocket connection establishment.
  273. For example, ``Docker exec`` needs POST. (`#3378 <https://github.com/aio-libs/aiohttp/pull/3378>`_)
  274. - Create a task per request handling. (`#3406 <https://github.com/aio-libs/aiohttp/pull/3406>`_)
  275. Bugfixes
  276. --------
  277. - Enable passing `access_log_class` via `handler_args` (`#3158 <https://github.com/aio-libs/aiohttp/pull/3158>`_)
  278. - Return empty bytes with end-of-chunk marker in empty stream reader. (`#3186 <https://github.com/aio-libs/aiohttp/pull/3186>`_)
  279. - Accept ``CIMultiDictProxy`` instances for ``headers`` argument in ``web.Response``
  280. constructor. (`#3207 <https://github.com/aio-libs/aiohttp/pull/3207>`_)
  281. - Don't uppercase HTTP method in parser (`#3233 <https://github.com/aio-libs/aiohttp/pull/3233>`_)
  282. - Make method match regexp RFC-7230 compliant (`#3235 <https://github.com/aio-libs/aiohttp/pull/3235>`_)
  283. - Add ``app.pre_frozen`` state to properly handle startup signals in sub-applications. (`#3237 <https://github.com/aio-libs/aiohttp/pull/3237>`_)
  284. - Enhanced parsing and validation of helpers.BasicAuth.decode. (`#3239 <https://github.com/aio-libs/aiohttp/pull/3239>`_)
  285. - Change imports from collections module in preparation for 3.8. (`#3258 <https://github.com/aio-libs/aiohttp/pull/3258>`_)
  286. - Ensure Host header is added first to ClientRequest to better replicate browser (`#3265 <https://github.com/aio-libs/aiohttp/pull/3265>`_)
  287. - Fix forward compatibility with Python 3.8: importing ABCs directly from the collections module will not be supported anymore. (`#3273 <https://github.com/aio-libs/aiohttp/pull/3273>`_)
  288. - Keep the query string by `normalize_path_middleware`. (`#3278 <https://github.com/aio-libs/aiohttp/pull/3278>`_)
  289. - Fix missing parameter ``raise_for_status`` for aiohttp.request() (`#3290 <https://github.com/aio-libs/aiohttp/pull/3290>`_)
  290. - Bracket IPv6 addresses in the HOST header (`#3304 <https://github.com/aio-libs/aiohttp/pull/3304>`_)
  291. - Fix default message for server ping and pong frames. (`#3308 <https://github.com/aio-libs/aiohttp/pull/3308>`_)
  292. - Fix tests/test_connector.py typo and tests/autobahn/server.py duplicate loop def. (`#3337 <https://github.com/aio-libs/aiohttp/pull/3337>`_)
  293. - Fix false-negative indicator end_of_HTTP_chunk in StreamReader.readchunk function (`#3361 <https://github.com/aio-libs/aiohttp/pull/3361>`_)
  294. - Release HTTP response before raising status exception (`#3364 <https://github.com/aio-libs/aiohttp/pull/3364>`_)
  295. - Fix task cancellation when ``sendfile()`` syscall is used by static file handling. (`#3383 <https://github.com/aio-libs/aiohttp/pull/3383>`_)
  296. - Fix stack trace for ``asyncio.TimeoutError`` which was not logged, when it is caught
  297. in the handler. (`#3414 <https://github.com/aio-libs/aiohttp/pull/3414>`_)
  298. Improved Documentation
  299. ----------------------
  300. - Improve documentation of ``Application.make_handler`` parameters. (`#3152 <https://github.com/aio-libs/aiohttp/pull/3152>`_)
  301. - Fix BaseRequest.raw_headers doc. (`#3215 <https://github.com/aio-libs/aiohttp/pull/3215>`_)
  302. - Fix typo in TypeError exception reason in ``web.Application._handle`` (`#3229 <https://github.com/aio-libs/aiohttp/pull/3229>`_)
  303. - Make server access log format placeholder %b documentation reflect
  304. behavior and docstring. (`#3307 <https://github.com/aio-libs/aiohttp/pull/3307>`_)
  305. Deprecations and Removals
  306. -------------------------
  307. - Deprecate modification of ``session.requote_redirect_url`` (`#2278 <https://github.com/aio-libs/aiohttp/pull/2278>`_)
  308. - Deprecate ``stream.unread_data()`` (`#3260 <https://github.com/aio-libs/aiohttp/pull/3260>`_)
  309. - Deprecated use of boolean in ``resp.enable_compression()`` (`#3318 <https://github.com/aio-libs/aiohttp/pull/3318>`_)
  310. - Encourage creation of aiohttp public objects inside a coroutine (`#3331 <https://github.com/aio-libs/aiohttp/pull/3331>`_)
  311. - Drop dead ``Connection.detach()`` and ``Connection.writer``. Both methods were broken
  312. for more than 2 years. (`#3358 <https://github.com/aio-libs/aiohttp/pull/3358>`_)
  313. - Deprecate ``app.loop``, ``request.loop``, ``client.loop`` and ``connector.loop`` properties. (`#3374 <https://github.com/aio-libs/aiohttp/pull/3374>`_)
  314. - Deprecate explicit debug argument. Use asyncio debug mode instead. (`#3381 <https://github.com/aio-libs/aiohttp/pull/3381>`_)
  315. - Deprecate body parameter in HTTPException (and derived classes) constructor. (`#3385 <https://github.com/aio-libs/aiohttp/pull/3385>`_)
  316. - Deprecate bare connector close, use ``async with connector:`` and ``await connector.close()`` instead. (`#3417 <https://github.com/aio-libs/aiohttp/pull/3417>`_)
  317. - Deprecate obsolete ``read_timeout`` and ``conn_timeout`` in ``ClientSession`` constructor. (`#3438 <https://github.com/aio-libs/aiohttp/pull/3438>`_)
  318. Misc
  319. ----
  320. - #3341, #3351