{ "info": { "author": "Michael Elsdorfer", "author_email": "michael@elsdorfer.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "trio-websockets\n===============\n\n|rtd| |pypi-v| |pypi-pyversions| |pypi-l| |pypi-wheel|\n\n.. |rtd| image:: https://readthedocs.org/projects/trio-websockets/badge/?version=latest\n :target: https://trio-websockets.readthedocs.io/\n\n.. |pypi-v| image:: https://img.shields.io/pypi/v/trio-websockets.svg\n :target: https://pypi.python.org/pypi/trio-websockets\n\n.. |pypi-pyversions| image:: https://img.shields.io/pypi/pyversions/trio-websockets.svg\n :target: https://pypi.python.org/pypi/trio-websockets\n\n.. |pypi-l| image:: https://img.shields.io/pypi/l/websockets.svg\n :target: https://pypi.python.org/pypi/trio-websockets\n\n.. |pypi-wheel| image:: https://img.shields.io/pypi/wheel/trio-websockets.svg\n :target: https://pypi.python.org/pypi/trio-websockets\n\n\nWhat is ``trio-websockets``?\n----------------------------\n\n``trio-websockets`` is a library for building WebSocket servers_ and clients_ in\nPython, based on ``trio``, an asynchronous I/O framework.\n\n.. _servers: https://github.com/miracle2k/trio-websockets/blob/master/example/server.py\n.. _clients: https://github.com/miracle2k/trio-websockets/blob/master/example/client.py\n\n\n**Currently a work in progress**. The status is:\n\n- The client-side works.\n- The server-side does not.\n\n\nHistory of the library\n----------------------\n\nThe code is originally forked from aaugustin's websockets_ library for asyncio,\nwith the following changes:\n\n- Rip out all asyncio things, replace with trio.\n- Rip out the websocket protocol code, replace with wsproto.\n\n.. _websockets: https://github.com/aaugustin/websockets\n\nWhat remains of the original websockets library itself?\n\n- Most of the remaining code seems to be additional error checking around connection\n state. Rather than a \"trio.BrokenStreamError\", you will receive a ConnectionClosed\n exception when trying to write on a closed connection.\n\n- The same/very similar interface to websockets, which might be slightly more\n user-friendly than a raw wsproto connection (say, exposing attributes like .subprotocol,\n which wsproto passes along during the ConnectionEstablished event).\n\n\nTODO\n----\n\n- Port the server-side.\n- Make the examples run.\n- Make the tests run.\n- Support for curio.\n- Cleanup documentation and readme.\n- Experiment with a different architecture, using reader/writer tasks.\n\n\nHow to use it\n-------------\n\nHere's a client that says \"Hello world!\":\n\n.. code:: python\n\n #!/usr/bin/env python\n\n import trio\n import trio_websockets\n\n async def hello(uri):\n async with trio_websockets.connect(uri) as websocket:\n await websocket.send(\"Hello world!\")\n\n trio.run(hello, 'ws://localhost:8765')\n\nAnd here's an echo server (for Python \u2265 3.6):\n\n.. code:: python\n\n #!/usr/bin/env python\n\n import trio\n import trio_websockets\n\n async def echo(websocket, path):\n async for message in websocket:\n await websocket.send(message)\n\n trio.run(trio_websockets.serve, echo, 'localhost', 8765)\n\nDoes that look good? `Start here`_.\n\n.. _Start here: https://trio-websockets.readthedocs.io/en/stable/intro.html\n\n\nWhat else?\n----------\n\nBug reports, patches and suggestions welcome! Just open an issue_ or send a\n`pull request`_.\n\n.. _issue: https://github.com/miracle2k/trio-websockets/issues/new\n.. _pull request: https://github.com/miracle2k/trio-websockets/compare/\n\n``trio-websockets`` is released under the `BSD license`_.\n\n.. _BSD license: https://trio-websockets.readthedocs.io/en/stable/license.html\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/miracle2k/trio-websockets", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "trio-websockets", "package_url": "https://pypi.org/project/trio-websockets/", "platform": "", "project_url": "https://pypi.org/project/trio-websockets/", "project_urls": { "Homepage": "https://github.com/miracle2k/trio-websockets" }, "release_url": "https://pypi.org/project/trio-websockets/0.2/", "requires_dist": null, "requires_python": "", "summary": "An implementation of the WebSocket Protocol (RFC 6455 & 7692)", "version": "0.2" }, "last_serial": 4222159, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "443f8d9a37a289fc7ffae063375e4d03", "sha256": "7f90c5caa7667abe7a4917c20225b2be5dd4411a2b8a572b2281fb986fcd6e02" }, "downloads": -1, "filename": "trio-websockets-0.1.tar.gz", "has_sig": false, "md5_digest": "443f8d9a37a289fc7ffae063375e4d03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34724, "upload_time": "2018-08-22T11:32:30", "url": "https://files.pythonhosted.org/packages/f2/86/2d2abb960ca0e6ad84378b595de30c9dc54cfc63cdaebb50fe36c8ec2231/trio-websockets-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "3d9f25cc6614c7449efc0c44a7bb8d91", "sha256": "8107e7dc42581c4c01c189a3f58b789f208dbce647e44d6f6caff343e2bd5081" }, "downloads": -1, "filename": "trio-websockets-0.2.tar.gz", "has_sig": false, "md5_digest": "3d9f25cc6614c7449efc0c44a7bb8d91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34691, "upload_time": "2018-08-30T11:01:25", "url": "https://files.pythonhosted.org/packages/a0/88/31c24c23c9be0c4a4a17c55a8369e8ee37390b8608bf0e0262131d38e792/trio-websockets-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3d9f25cc6614c7449efc0c44a7bb8d91", "sha256": "8107e7dc42581c4c01c189a3f58b789f208dbce647e44d6f6caff343e2bd5081" }, "downloads": -1, "filename": "trio-websockets-0.2.tar.gz", "has_sig": false, "md5_digest": "3d9f25cc6614c7449efc0c44a7bb8d91", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34691, "upload_time": "2018-08-30T11:01:25", "url": "https://files.pythonhosted.org/packages/a0/88/31c24c23c9be0c4a4a17c55a8369e8ee37390b8608bf0e0262131d38e792/trio-websockets-0.2.tar.gz" } ] }