{ "info": { "author": "Jeremy Carbaugh", "author_email": "jcarbaugh@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "python-roku\n===========\n\nScrew remotes. Control your `Roku `_ via Python.\n\n.. image:: https://travis-ci.org/jcarbaugh/python-roku.svg?branch=master\n :target: https://travis-ci.org/jcarbaugh/python-roku\n\n\nInstallation\n------------\n\n::\n\n pip install roku\n\n\nUsage\n-----\n\n\nThe Basics\n~~~~~~~~~~\n\nTo start, import the Roku object and create it with the IP of your Roku.\n::\n\n >>> from roku import Roku\n >>> roku = Roku('192.168.10.163')\n\nThe Roku object has a method for each of the buttons on the remote.\n::\n\n >>> roku.home()\n >>> roku.right()\n >>> roku.select()\n\nTo see a full list of available commands, use the *commands* property.\n::\n\n >>> roku.commands\n ['back', 'backspace', 'down', 'enter', 'forward', 'home', 'info', 'left', 'literal', 'play', 'replay', 'reverse', 'right', 'search', 'select', 'up']\n\nIf you are following along on your home network and are connected to your Roku, you should see it doing stuff. *Cool!*\n\n\nApps\n~~~~\n\nThe *apps* property will return a list of the applications on your device.\n::\n\n >>> roku.apps\n [, , ]\n\nApps have *id*, *name*, and *version* properties.\n::\n\n >>> app = roku.apps[0]\n >>> print app.id, app.name, app.version\n 2285 Hulu Plus 2.7.6\n\nYou can get an individual app from the Roku object by either its *name* or *id*.\n::\n\n >>> roku['Hulu Plus']\n \n >>> roku[2285]\n \n\nSeeing the reference to this Hulu Plus app makes me really want to watch the latest episode of `Nashville `_. Let's launch it!\n::\n\n >>> hulu = roku['Hulu Plus']\n >>> hulu.launch()\n\nAgain, if you are following along at home, you should see that your Roku has launched the Hulu Plus app. Want to see the app's entry in the Channel Store?\n::\n\n >>> hulu.store()\n\nYou can also get the app's icon.\n::\n\n >>> with open('hulu.png', 'w') as f:\n ... f.write(hulu.icon)\n\nYou can get the current running app.\n::\n\n >>> roku.active_app\n \n\n\nEntering Text\n~~~~~~~~~~~~~\n\nOkay, I've already seen all of the available episodes of Nashville, so I'm going to search for *Stargate*. With the search open and waiting for text entry::\n\n >>> roku.literal('stargate')\n\nWhat if I now want to watch *The Informant!*? Again, with the search open and waiting for text entry::\n\n >>> roku.literal('The Informant!')\n\nThis will iterate over each character, sending it individually to the Roku.\n\n\nAdvanced Stuff\n--------------\n\n\nDiscovery\n~~~~~~~~~\n\nRoku devices can be discovered using `SSDP `_. A class method is available on the Roku object that will return Roku object instances for each device found on the same network.\n::\n\n >>> Roku.discover()\n []\n\nIt may take a few seconds for a device to be found. You can call discover again or change the *timeout* or *retries* parameters on the discover method. This will take longer, but will find more devices.\n::\n\n >>> Roku.discover(timeout=10)\n [, ]\n\nThanks to `Dan Krause `_ for his `SSDP code `_.\n\n\nSensors\n~~~~~~~\n\nNewer Roku remotes have extra sensors built into them that measure acceleration, orientation, and other things.You can mimic these sensors using the provided helper methods.\n::\n\n >>> roku.orientation(1, 1, 1)\n\nThe parameters to all of the sensor methods are x, y, and z values. Available methods include:\n\n* acceleration - in each dimension relative to free fall measured in meters/sec^2\n* magnetic - magnetic field strength in microtesla\n* orientation - angular displacement from flat/level and north in radians\n* rotation - angular rotation rate about each axis using the right hand rule in radians/sec\n\n\nTouch\n~~~~~\n\nSome Roku input devices support touch. The parameters to the *touch* method are the *x* and *y* coordinates of the touch.\n::\n\n >>> roku.touch(10, 40)\n\nYou can change the event triggered by passing an optional *op* parameter.\n::\n\n >>> roku.touch(10, 40, op='up')\n\nSupported events are:\n\n* down\n* up\n* press (down and up)\n* move\n* cancel\n\nMultitouch is not yet supported in this package.\n\nIntegrations\n~~~~~~~~~~~~\n* `pyrokuserve `_\n* `Home Assistant `_\n\nGeneric Input\n~~~~~~~~~~~~~\n\nBoth the sensor and touch methods rely on the generic *input* method for sending data to a running application. If you refuse to use covenience methods because they make people lazy and weak, you can call the sensor and touch methods directly.\n::\n\n >>> params = {'touch.0.x': 10, 'touch.0.y': 20, 'touch.0.op': 'press'}\n >>> roku.input(params)\n\nMore information about input, touch, and sensors is available in the `Roku External Control docs `_.\n\n\nTODO\n----\n\n* Tests, of course.\n* Multitouch support.\n* A Flask proxy server that can listen to requests and forward them to devices on the local network. Control multiple devices at once, eh?\n* A server that mimics the Roku interface so you can make your own Roku-like stuff.\n* A task runner that will take a set of commands and run them with delays that are appropriate for most devices.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jcarbaugh/python-roku", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "roku", "package_url": "https://pypi.org/project/roku/", "platform": "any", "project_url": "https://pypi.org/project/roku/", "project_urls": { "Homepage": "https://github.com/jcarbaugh/python-roku" }, "release_url": "https://pypi.org/project/roku/3.1/", "requires_dist": [ "lxml (<4.5.0,>=4.4.0)", "requests (<2.11,>=2.10)", "six" ], "requires_python": "", "summary": "Client for the Roku media player", "version": "3.1" }, "last_serial": 5630848, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "cfac78915b26fd7949e2e79ba0b26e20", "sha256": "ed707d48e71e7af49d205ca31739916bd37855332291239085fcfaf204834ce7" }, "downloads": -1, "filename": "roku-1.0.tar.gz", "has_sig": false, "md5_digest": "cfac78915b26fd7949e2e79ba0b26e20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7558, "upload_time": "2014-01-04T20:34:17", "url": "https://files.pythonhosted.org/packages/57/1d/9164d55b5bc9601730125f433963607b2ac50add05d60afcdcb821889ee5/roku-1.0.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "6bd0fc8c1b2c8349a4c8549695e273f0", "sha256": "7ac9d50bfa4fdc94977e0fd34d93c5d200f2b4fd2ea4d7dfbf63f894919e8e54" }, "downloads": -1, "filename": "roku-2.0.tar.gz", "has_sig": false, "md5_digest": "6bd0fc8c1b2c8349a4c8549695e273f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9033, "upload_time": "2014-11-17T16:13:44", "url": "https://files.pythonhosted.org/packages/6a/b7/efc2f1e36b0d7b5a81789530736e5035f23085bc0faec86e2bbb4d22928c/roku-2.0.tar.gz" } ], "3.0": [ { "comment_text": "", "digests": { "md5": "a6c45571e5e7d26fe2008f8cddab9f27", "sha256": "6b702178f7fcb88da18d8c80bac5ea01fa3fb7d36f5f70fc9b75f3f07e9dff14" }, "downloads": -1, "filename": "roku-3.0.tar.gz", "has_sig": false, "md5_digest": "a6c45571e5e7d26fe2008f8cddab9f27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12932, "upload_time": "2019-07-29T22:09:06", "url": "https://files.pythonhosted.org/packages/ef/6d/db7b811daa8173e7114cd2c3ae138729f6bbcf240f78c543e060af5daf0e/roku-3.0.tar.gz" } ], "3.1": [ { "comment_text": "", "digests": { "md5": "9ad0e70425672b7ae6349f191191a872", "sha256": "590f3ab42f576feebeb59ef6206628aeef2f0d7b43922260b9b7dc2ff683e2fd" }, "downloads": -1, "filename": "roku-3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9ad0e70425672b7ae6349f191191a872", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12011, "upload_time": "2019-08-04T15:13:04", "url": "https://files.pythonhosted.org/packages/13/ff/c8415c48b5f816818d863bf0f35c2432d904a764bff42a4d8239a849565d/roku-3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2886f7aa4a093aa8b5963cac10d116ab", "sha256": "4de0d7a1aa4b513e457cdd9af2720f6b7c8fca9028cc6583d47c9db8a2b7d968" }, "downloads": -1, "filename": "roku-3.1.tar.gz", "has_sig": false, "md5_digest": "2886f7aa4a093aa8b5963cac10d116ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10382, "upload_time": "2019-08-04T15:13:06", "url": "https://files.pythonhosted.org/packages/45/05/8f04f712a698cec573aa319880f11454fb18ed59ccbe257db30f5d27a75b/roku-3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9ad0e70425672b7ae6349f191191a872", "sha256": "590f3ab42f576feebeb59ef6206628aeef2f0d7b43922260b9b7dc2ff683e2fd" }, "downloads": -1, "filename": "roku-3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9ad0e70425672b7ae6349f191191a872", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12011, "upload_time": "2019-08-04T15:13:04", "url": "https://files.pythonhosted.org/packages/13/ff/c8415c48b5f816818d863bf0f35c2432d904a764bff42a4d8239a849565d/roku-3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2886f7aa4a093aa8b5963cac10d116ab", "sha256": "4de0d7a1aa4b513e457cdd9af2720f6b7c8fca9028cc6583d47c9db8a2b7d968" }, "downloads": -1, "filename": "roku-3.1.tar.gz", "has_sig": false, "md5_digest": "2886f7aa4a093aa8b5963cac10d116ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10382, "upload_time": "2019-08-04T15:13:06", "url": "https://files.pythonhosted.org/packages/45/05/8f04f712a698cec573aa319880f11454fb18ed59ccbe257db30f5d27a75b/roku-3.1.tar.gz" } ] }