{ "info": { "author": "Jacob Alexander", "author_email": "haata@kiibohd.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries" ], "description": "# hidio Client Python Library\nHID-IO Client Side Library for Python\n\n[![Linux Status](https://github.com/hid-io/hid-io/workflows/Rust%20Linux/badge.svg)](https://github.com/hid-io/hid-io/actions)\n[![macOS Status](https://github.com/hid-io/hid-io/workflows/Rust%20macOS/badge.svg)](https://github.com/hid-io/hid-io/actions)\n[![Windows Status](https://github.com/hid-io/hid-io/workflows/Rust%20Windows/badge.svg)](https://github.com/hid-io/hid-io/actions)\n\n[![Visit our IRC channel](https://kiwiirc.com/buttons/irc.freenode.net/hid-io.png)](https://kiwiirc.com/client/irc.freenode.net/#hid-io)\n\n## Getting\n\n```bash\npip install hidio\n```\n\n\n## Overview\n\nThis is a convenience Python library for the HID-IO daemon which handles automatic reconnection if the server goes down for any reason.\nThe library also handles the HID-IO authentication procedure (key negotiation and TLS wrapping).\n\n\n## Usage\n\n```python\nimport asyncio\nimport sys\n\nimport hidio.client\n\n# Optional callbacks\nclass MyHIDIOClient(hidio.client.HIDIOClient):\n async def on_connect(self, cap):\n print(\"Connected!\")\n print(\"Connected API Call\", await cap.alive().a_wait())\n\n\n async def on_disconnect(self):\n print(\"Disconnected!\")\n\n\nasync def main():\n client = MyHIDIOClient('Python example.py')\n # Connect the client to the server using a background task\n # This will automatically reconnect\n tasks = [asyncio.gather(*[client.connect(auth=hidio.client.HIDIOClient.AUTH_BASIC)], return_exceptions=True)]\n while client.retry_connection_status():\n if client.capability_hidioserver():\n try:\n print(\"API Call\", await asyncio.wait_for(\n client.capability_hidioserver().alive().a_wait(),\n timeout=2.0\n ))\n print(\"API Call\", await asyncio.wait_for(\n client.capability_authenticated().nodes().a_wait(),\n timeout=2.0\n ))\n except asyncio.TimeoutError:\n print(\"Alive timeout.\")\n continue\n await asyncio.sleep(5)\n\n\ntry:\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main())\nexcept KeyboardInterrupt:\n print(\"Ctrl+C detected, exiting...\")\n sys.exit(1)\n```\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kiibohd/kll", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "hidio", "package_url": "https://pypi.org/project/hidio/", "platform": "", "project_url": "https://pypi.org/project/hidio/", "project_urls": { "Homepage": "https://github.com/kiibohd/kll" }, "release_url": "https://pypi.org/project/hidio/0.1.0b1/", "requires_dist": [ "cython>=0.29.12", "pycapnp==0.6.4" ], "requires_python": ">=3.7", "summary": "HID-IO Python Library", "version": "0.1.0b1" }, "last_serial": 5972517, "releases": { "0.1.0b1": [ { "comment_text": "", "digests": { "md5": "4949949ab4608a4cc7682431e30f303b", "sha256": "21e2a0874aa6b807d0ecf2795dfb130df7881abdb1d91aef0e09f75a14b61e6d" }, "downloads": -1, "filename": "hidio-0.1.0b1-py3-none-any.whl", "has_sig": false, "md5_digest": "4949949ab4608a4cc7682431e30f303b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 28158, "upload_time": "2019-10-14T17:40:17", "url": "https://files.pythonhosted.org/packages/84/46/f9c0ba89d3819fa0d09ef86276154dfb9f5c2f180acbb6373dd7acc0a6ca/hidio-0.1.0b1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "223fc361d234327a991e28bb08467b77", "sha256": "68a835685cf6391172d4a00efd7ec49ed169656500a0dafe3ee5ab236e6ed8f2" }, "downloads": -1, "filename": "hidio-0.1.0b1.tar.gz", "has_sig": false, "md5_digest": "223fc361d234327a991e28bb08467b77", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 11266, "upload_time": "2019-10-14T17:40:24", "url": "https://files.pythonhosted.org/packages/10/b0/ab433b1682520546cf88416350c2b57d7e101032ec981db54ddd0f357f52/hidio-0.1.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4949949ab4608a4cc7682431e30f303b", "sha256": "21e2a0874aa6b807d0ecf2795dfb130df7881abdb1d91aef0e09f75a14b61e6d" }, "downloads": -1, "filename": "hidio-0.1.0b1-py3-none-any.whl", "has_sig": false, "md5_digest": "4949949ab4608a4cc7682431e30f303b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7", "size": 28158, "upload_time": "2019-10-14T17:40:17", "url": "https://files.pythonhosted.org/packages/84/46/f9c0ba89d3819fa0d09ef86276154dfb9f5c2f180acbb6373dd7acc0a6ca/hidio-0.1.0b1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "223fc361d234327a991e28bb08467b77", "sha256": "68a835685cf6391172d4a00efd7ec49ed169656500a0dafe3ee5ab236e6ed8f2" }, "downloads": -1, "filename": "hidio-0.1.0b1.tar.gz", "has_sig": false, "md5_digest": "223fc361d234327a991e28bb08467b77", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7", "size": 11266, "upload_time": "2019-10-14T17:40:24", "url": "https://files.pythonhosted.org/packages/10/b0/ab433b1682520546cf88416350c2b57d7e101032ec981db54ddd0f357f52/hidio-0.1.0b1.tar.gz" } ] }