{ "info": { "author": "Fantix King", "author_email": "fantix.king@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "=====\naioh2\n=====\n\n.. image:: https://img.shields.io/pypi/v/aioh2.svg\n :target: https://pypi.python.org/pypi/aioh2\n\n.. image:: https://img.shields.io/travis/decentfox/aioh2.svg\n :target: https://travis-ci.org/decentfox/aioh2\n\n.. image:: https://readthedocs.org/projects/aioh2/badge/?version=latest\n :target: https://readthedocs.org/projects/aioh2/?badge=latest\n :alt: Documentation Status\n\n\nHTTP/2 implementation with hyper-h2_ on Python 3 asyncio.\n\n* Free software: BSD license\n* Documentation: https://aioh2.readthedocs.org.\n\nFeatures\n--------\n\n* Asynchronous HTTP/2 client and server\n* Multiplexing streams of data with managed flow and priority control\n* Optional tickless health check\n* More to come\n\nNon-features:\n\n* Request/Response wrappers\n* Web server, dispatcher, cookie, etc\n* HTTP/2 upgrade\n\nExample\n-------\n\nA server saying hello:\n\n.. code-block:: python\n\n # Server request handler\n async def on_connected(proto):\n try:\n while True:\n # Receive a request from queue\n stream_id, headers = await proto.recv_request()\n\n # Send response headers\n await proto.start_response(stream_id, {':status': '200'})\n\n # Response body starts with \"hello\"\n await proto.send_data(stream_id, b'hello, ')\n\n # Read all request body as a name from client side\n name = await proto.read_stream(stream_id, -1)\n\n # Amend response body with the name\n await proto.send_data(stream_id, name)\n\n # Send trailers with the length of the name\n await proto.send_trailers(stream_id, {'len': str(len(name))})\n except asyncio.CancelledError:\n # do cleanup here\n pass\n\n # Start server on random port, with maximum concurrent requests of 3\n server = await aioh2.start_server(on_connected, port=0, concurrency=3)\n port = server.sockets[0].getsockname()[1]\n\n\nAnd a client to try out:\n\n.. code-block:: python\n\n # Open client connection\n client = await aioh2.open_connection('0.0.0.0', port,\n functional_timeout=0.1)\n\n # Optionally wait for an ack of tickless ping - a.k.a. until functional\n await asyncio.sleep(0.1) # simulate client being busy with something else\n rtt = await client.wait_functional()\n if rtt:\n print('Round-trip time: %.1fms' % (rtt * 1000))\n\n # Start request with headers\n stream_id = await client.start_request(\n {':method': 'GET', ':path': '/index.html'})\n\n # Send my name \"world\" as whole request body\n await client.send_data(stream_id, b'world', end_stream=True)\n\n # Receive response headers\n headers = await client.recv_response(stream_id)\n print('Response headers:', headers)\n\n # Read all response body\n resp = await client.read_stream(stream_id, -1)\n print('Response body:', resp)\n\n # Read response trailers\n trailers = await client.recv_trailers(stream_id)\n print('Response trailers:', trailers)\n\n client.close_connection()\n await asyncio.sleep(.1)\n\n\nAbove example can be found at `examples/core.py`.\n\n\nCredits\n-------\n\nA big thanks to the great library hyper-h2_ from `Cory Benfield`_.\n\n`DecentFoX Studio`_ is a software outsourcing company delivering high-quality\nweb-based products and mobile apps for global customers with agile methodology,\nfocusing on bleeding-edge technologies and fast-developing scalable architectures.\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _hyper-h2: https://github.com/python-hyper/hyper-h2\n.. _`DecentFoX Studio`: http://decentfox.com\n.. _`Cory Benfield`: https://github.com/Lukasa\n\n\n=======\nHistory\n=======\n\n0.2.1 (2017-12-03)\n------------------\n\n* Updated to h2 3.0 (Contributed by Arthur Darcet and Peter Wu)\n* Dropped support for Python 3.3\n\n0.1.0 (2016-2-6)\n----------------\n\n* First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/decentfox/aioh2", "keywords": "aioh2", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "aioh2", "package_url": "https://pypi.org/project/aioh2/", "platform": "", "project_url": "https://pypi.org/project/aioh2/", "project_urls": { "Homepage": "https://github.com/decentfox/aioh2" }, "release_url": "https://pypi.org/project/aioh2/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "HTTP/2 implementation with hyper-h2 on Python 3 asyncio.", "version": "0.2.2" }, "last_serial": 3551899, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "2f0dd0867b0c2445c0a36ed37f116440", "sha256": "c682a32af6d89a45f435a08b5761239eb1d6e1a97f6f03d1804ab7e46e4940b9" }, "downloads": -1, "filename": "aioh2-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2f0dd0867b0c2445c0a36ed37f116440", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7971, "upload_time": "2016-02-06T11:03:19", "url": "https://files.pythonhosted.org/packages/f3/b9/b2b563329aa63229af31b9d987e11e57b40dbaa74081a93425fb83fe8ca1/aioh2-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cc8817e598822290b6d19416c7adb6ed", "sha256": "443ff5a381f2118d16b37f49cdf25c455d9099b2a1b7fd786f32828e5c2df5aa" }, "downloads": -1, "filename": "aioh2-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cc8817e598822290b6d19416c7adb6ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18587, "upload_time": "2016-02-06T11:03:25", "url": "https://files.pythonhosted.org/packages/3e/cc/28d4ec84e02b93e4dd91e838f13afd110d21d44b72a239f31f78b2962f0f/aioh2-0.1.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "8427a42c214ed673f60f12e6da451d2d", "sha256": "f4e824755acb2477e4b24f0501d4211631d3a16a614c103d1d8b866bd284e457" }, "downloads": -1, "filename": "aioh2-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8427a42c214ed673f60f12e6da451d2d", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 12945, "upload_time": "2017-12-03T09:16:45", "url": "https://files.pythonhosted.org/packages/f5/4a/eb298c5dd8bbaedddc4c46630013e3c9433fc30a98a0cd3dbd86af7619aa/aioh2-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a390d2039ac240c1420be9013d4bcdde", "sha256": "70ab04aaa5e29f4503d7648ef0807e0000202114b654e4228fd63ba0d80d6642" }, "downloads": -1, "filename": "aioh2-0.2.1.tar.gz", "has_sig": false, "md5_digest": "a390d2039ac240c1420be9013d4bcdde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24552, "upload_time": "2017-12-03T09:16:33", "url": "https://files.pythonhosted.org/packages/6c/e5/ec5a581d2d65291134d69cd72d1c2721f09be081d666a4e55ce3f48bc474/aioh2-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "dcc0d6b5cbd51315344ebfd8c1be8b16", "sha256": "8da7b49261d9bbfe71b3b9e994eca1fcc53890c7868fc96eb6b9027e3f27220e" }, "downloads": -1, "filename": "aioh2-0.2.2.tar.gz", "has_sig": false, "md5_digest": "dcc0d6b5cbd51315344ebfd8c1be8b16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24585, "upload_time": "2018-02-05T02:33:38", "url": "https://files.pythonhosted.org/packages/44/91/7fe6c06690b53bf105a6bf93ec3c38a20e40f578bd8e1fda0d9accf728fd/aioh2-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dcc0d6b5cbd51315344ebfd8c1be8b16", "sha256": "8da7b49261d9bbfe71b3b9e994eca1fcc53890c7868fc96eb6b9027e3f27220e" }, "downloads": -1, "filename": "aioh2-0.2.2.tar.gz", "has_sig": false, "md5_digest": "dcc0d6b5cbd51315344ebfd8c1be8b16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24585, "upload_time": "2018-02-05T02:33:38", "url": "https://files.pythonhosted.org/packages/44/91/7fe6c06690b53bf105a6bf93ec3c38a20e40f578bd8e1fda0d9accf728fd/aioh2-0.2.2.tar.gz" } ] }