{ "info": { "author": "Spinifex Group", "author_email": "justin.crown@spinifexgroup.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3" ], "description": "# python-userful\n\nUnofficial Python Client For [the Userful REST API](http://dev.userful.com/rest/#).\n\nNote that this client is not feature complete, calls will be added as they are required.\n\n# Usage\n\nAll client methods return a `requests.Response` object. None of them do status checking, it\nis up to the user of the client to decide whether to check the return status code.\n\n## Initialization\n\nThe client can be configured either using environment variables or when instantiating the client.\n\nIf authentication fails due to a misconfiguration, a `requests.exceptions.HTTPError` will be raised.\n\n### Using Environment Variables\n\nThe following environment variables can be used to configure the client:\n\n* USERFUL_USER - username for authentication (required)\n* USERFUL_PASS - password for authentication (required). Keep in mind that storing secrets in environment\n variables can be hazardous. As such, you might want to provide your password during instiation instead.\n* USERFUL_HOST - hostname or IP address of userful API (required)\n* USERFUL_PORT - port of userful API (optional, defaults to `9000`)\n\nAfter exporting these variables, the client can be instantiated as follows:\n\n```\nfrom userful.client import UserfulClient\n\nclient = UserfulClient()\n```\n\n### Passing during initialization\n```\nfrom userful.client import UserfulClient\n\nclient = UserfulClient(user=\"myuser\", password=\"s00persecret\", host=\"myuserfulhost.com\")\n```\n\n# Recipes\n\n## Switching the source on a zone\n```\n# Change the source of the zone. This DOES NOT actually change what is on the screen.\n# However, this source now becomes the default for the zone.\nclient.switch_source_by_zone('Zone-0', 'Userful Desktop')\n\n# Actually make the zone start playing the new source\nclient.play_by_zone('Zone-0')\n```\n\n## Updating an existing source\n```\n# The PUT call to update a source is not idempotent, so we need to start by\n# grabbing the existing source object\n\npayload = client.get_sources(name='my_source')\n\n# Get the ID of the source\nsource_id = payload['sourceId']\n\n# Change the name of the source in the payload\npayload['sourceName'] = 'my_new_source_name'\n\n# Send the new data to the API\nres = client.update_source(source_id, payload)\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/SpinifexGroup/python-userful", "keywords": "userful", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "userful", "package_url": "https://pypi.org/project/userful/", "platform": "", "project_url": "https://pypi.org/project/userful/", "project_urls": { "Homepage": "https://github.com/SpinifexGroup/python-userful" }, "release_url": "https://pypi.org/project/userful/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Unofficial python client for userful API", "version": "0.1.0" }, "last_serial": 4944970, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "37bbf82f9fe4cf3250d39ffe6ee1285f", "sha256": "ab45c31b321e88cc63dad46bf9a49f608caebc92b2973f51c414fa8c152e9f1b" }, "downloads": -1, "filename": "userful-0.1.0.tar.gz", "has_sig": false, "md5_digest": "37bbf82f9fe4cf3250d39ffe6ee1285f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4228, "upload_time": "2019-03-15T16:31:59", "url": "https://files.pythonhosted.org/packages/04/94/31604aa5029e6d835f743658f28420946dfabafe37c3a92f1d54494b2169/userful-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37bbf82f9fe4cf3250d39ffe6ee1285f", "sha256": "ab45c31b321e88cc63dad46bf9a49f608caebc92b2973f51c414fa8c152e9f1b" }, "downloads": -1, "filename": "userful-0.1.0.tar.gz", "has_sig": false, "md5_digest": "37bbf82f9fe4cf3250d39ffe6ee1285f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4228, "upload_time": "2019-03-15T16:31:59", "url": "https://files.pythonhosted.org/packages/04/94/31604aa5029e6d835f743658f28420946dfabafe37c3a92f1d54494b2169/userful-0.1.0.tar.gz" } ] }