{ "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 python-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\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\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\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.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bah2830/python-roku", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "python-roku", "package_url": "https://pypi.org/project/python-roku/", "platform": "any", "project_url": "https://pypi.org/project/python-roku/", "project_urls": { "Homepage": "https://github.com/bah2830/python-roku" }, "release_url": "https://pypi.org/project/python-roku/3.1.5/", "requires_dist": null, "requires_python": "", "summary": "Client for the Roku media player", "version": "3.1.5" }, "last_serial": 3489913, "releases": { "3.1.3": [ { "comment_text": "", "digests": { "md5": "d9bda5dd3070b862b918003d1e1b4beb", "sha256": "2b2b1b231c5d7b54c1f76773adfb601592c469c0e7f84d32822d5d404c0de274" }, "downloads": -1, "filename": "python-roku-3.1.3.tar.gz", "has_sig": false, "md5_digest": "d9bda5dd3070b862b918003d1e1b4beb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9330, "upload_time": "2017-05-09T13:28:19", "url": "https://files.pythonhosted.org/packages/e7/ee/39d1cfcd5821352eea2451c26816767d388b63f4c7fd9baaac53408f0e4d/python-roku-3.1.3.tar.gz" } ], "3.1.4": [ { "comment_text": "", "digests": { "md5": "0852ef444f29abc3d0eafeb5d07efa0f", "sha256": "9b90091f646943b1baba5db631261561b5d687577840d2c9eb7498d60eb3579b" }, "downloads": -1, "filename": "python_roku-3.1.4-py2-none-any.whl", "has_sig": false, "md5_digest": "0852ef444f29abc3d0eafeb5d07efa0f", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 12868, "upload_time": "2017-06-19T17:13:05", "url": "https://files.pythonhosted.org/packages/ed/c8/0c0b4db386661d978add28b35e420ab0f977b9c2df6ee570d38022d39da6/python_roku-3.1.4-py2-none-any.whl" } ], "3.1.5": [ { "comment_text": "", "digests": { "md5": "89fd12c43344a1676247d0da194f394d", "sha256": "f515c2991b0f343c7821350d9fb012322d705b136a2876912f067a4b63193809" }, "downloads": -1, "filename": "python-roku-3.1.5.tar.gz", "has_sig": false, "md5_digest": "89fd12c43344a1676247d0da194f394d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10098, "upload_time": "2018-01-15T02:31:15", "url": "https://files.pythonhosted.org/packages/f0/10/a09e65e761812511042e61bf00fb8bbbd255148d8c1a01e52a0616567351/python-roku-3.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "89fd12c43344a1676247d0da194f394d", "sha256": "f515c2991b0f343c7821350d9fb012322d705b136a2876912f067a4b63193809" }, "downloads": -1, "filename": "python-roku-3.1.5.tar.gz", "has_sig": false, "md5_digest": "89fd12c43344a1676247d0da194f394d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10098, "upload_time": "2018-01-15T02:31:15", "url": "https://files.pythonhosted.org/packages/f0/10/a09e65e761812511042e61bf00fb8bbbd255148d8c1a01e52a0616567351/python-roku-3.1.5.tar.gz" } ] }