{ "info": { "author": "Mike Helmick", "author_email": "mikehelmick@me.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Communications :: Chat", "Topic :: Internet", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Python-Netflix\n==============\n\nPython-Netflix is a Python Library to interface with `Netflix REST API `_ & OAuth\n\nFeatures\n--------\n\n* Retrieve user information\n* Retrieve queue information\n* Add items to queue\n* And many more, supports all REST endpoints\n\n\nInstallation\n------------\n\nInstalling Python-Netflix is simple: ::\n\n $ pip install python-netflix\n\nUsage\n-----\n\nAuthorization URL\n~~~~~~~~~~~~~~~~~\n::\n\n n = NetflixAPI(api_key='*your app key*',\n api_secret='*your app secret*',\n callback_url='http://www.example.com/callback/')\n\n auth_props = n.get_authentication_tokens()\n auth_url = auth_props['auth_url']\n\n #Store this token in a session or something for later use in the next step.\n oauth_token_secret = auth_props['oauth_token_secret']\n\n print 'Connect with Netflix via %s' % auth_url\n\nOnce you click \"Allow\" be sure that there is a URL set up to handle getting finalized tokens and possibly adding them to your database to use their information at a later date.\n\nHandling the callback\n~~~~~~~~~~~~~~~~~~~~~\n::\n\n # In Django, you'd do something like\n # oauth_token = request.GET.get('oauth_verifier')\n # oauth_verifier = request.GET.get('oauth_verifier')\n \n oauth_token = *Grab oauth token from URL*\n oauth_verifier = *Grab oauth verifier from URL*\n \n #Initiate the NetflixAPI class in your callback.\n n = NetflixAPI(api_key='*your app key*',\n api_secret='*your app secret*',\n oauth_token=oauth_token,\n oauth_token_secret=session['netflix_session_keys'][ 'oauth_token_secret'])\n \n authorized_tokens = n.get_auth_tokens(oauth_verifier)\n \n final_oauth_token = authorized_tokens['oauth_token']\n final_oauth_token_secret = authorized_tokens['oauth_token_secret']\n final_user_id = authorized_tokens['user_id']\n\nSave those tokens and user_id to the database for a later use?\n\nReturn a list of the users Instant Queue\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n::\n\n n = NetflixAPI(api_key = '*your app key*',\n api_secret = '*your app secret*',\n oauth_token=final_tokens['oauth_token'],\n oauth_token_secret=final_tokens['oauth_token_secret'])\n\n instant_queue = n.get('users/*final_user_id*/queues/instant')\n print instant_queue\n\nAdd Gabriel Iglesias: Hot and Fluffy to Instant Queue\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n::\n\n # Assume you are using the same NetflixAPI instance as above\n try:\n add_to_queue = n.post('users/*final_user_id*/queues/instant', params={'title_ref': 'http://api.netflix.com/catalog/titles/movies/70072945'})\n\n print add_to_queue\n\n # You can also added \"position\" to the params to set where this media will be positioned on the users queue.\n except NetflixAPIError:\n # This returns the added item if successful.\n # If it's already in the queue, it will return a NetflixAPIError, code 412 \n\nRemove Gabriel Iglesias: Hot and Fluffy to Instant Queue\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n::\n\n # Assume you are using the same NetflixAPI instance as above\n # When querying for the users Queue, when iterating over the Queue items\n # you can use the 'id' for the next call. Where it says *final_user_id*\n # that is automatically returned from the Netflix Instant Queue response.\n\n del_from_queue = n.delete('http://api-public.netflix.com/users/*final_user_id*/queues/instant/available/2/70072945')\n\n print del_from_queue\n\nRate Gabriel Iglesias: Hot and Fluffy\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n::\n\n try:\n # Create a new rating\n create_rating = n.post('users/*final_user_id*/ratings/title/actual/70072945', params={'rating': '5'})\n\n print create_rating\n except NetflixAPIError:\n # This returns a status message if successful.\n # If it's already been rated, it will return a NetflixAPIError, code 422\n pass\n\n\n # Update/Clear rating\n update_rating = n.put('users/*final_user_id*/ratings/title/actual/70072945', params={'rating': 'no_opinion'})\n\n print update_rating", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/michaelhelmick/python-netflix/zipball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michaelhelmick/python-netflix/", "keywords": "python netflix oauth api", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "python-netflix", "package_url": "https://pypi.org/project/python-netflix/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-netflix/", "project_urls": { "Download": "https://github.com/michaelhelmick/python-netflix/zipball/master", "Homepage": "https://github.com/michaelhelmick/python-netflix/" }, "release_url": "https://pypi.org/project/python-netflix/0.4.1/", "requires_dist": null, "requires_python": null, "summary": "A Python Library to interface with Netflix REST API & OAuth", "version": "0.4.1" }, "last_serial": 798013, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "cd65a2a91aa85d93c6277e0fd34a78e1", "sha256": "425798bed1f46c8c9e855b503f862e431b01b8a5978dc08beedb3b6729a77a3c" }, "downloads": -1, "filename": "python-netflix-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cd65a2a91aa85d93c6277e0fd34a78e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4234, "upload_time": "2012-01-20T21:47:47", "url": "https://files.pythonhosted.org/packages/45/cd/13c82692e3b24d836d22c2ae2f934fd700cf2460a86f42f87dbde3b561df/python-netflix-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7cd6205744d59c30f38a3128271456f2", "sha256": "506bee388e34a4b0d36a1dd0ea6c1e94ffd5f9ab86cb70d04be612e7757d56f1" }, "downloads": -1, "filename": "python-netflix-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7cd6205744d59c30f38a3128271456f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4229, "upload_time": "2012-02-02T05:09:16", "url": "https://files.pythonhosted.org/packages/09/e8/67703005a2c520ff3fb6333fdfffa4364d81fa85055ef6c081cf688674bc/python-netflix-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "0221990788f7af60693d0dd920f9d39b", "sha256": "2397d66fec83f5fcbb739af4d5e3cc339e311114f56a310545b476e9b59686b6" }, "downloads": -1, "filename": "python-netflix-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0221990788f7af60693d0dd920f9d39b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4284, "upload_time": "2012-06-20T20:32:39", "url": "https://files.pythonhosted.org/packages/36/9c/ea90cddea56a9144d59836a1ad39b403973b8e9690ebdbd15073cc2a3454/python-netflix-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "0c60e66bdcebb109f7902ee4a31ab310", "sha256": "1fc8a36dc37fbadba49c924f7f07922e3ac52019a7b9500f8a52bcf457dc0294" }, "downloads": -1, "filename": "python-netflix-0.3.0.tar.gz", "has_sig": false, "md5_digest": "0c60e66bdcebb109f7902ee4a31ab310", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4313, "upload_time": "2012-06-20T23:03:33", "url": "https://files.pythonhosted.org/packages/f5/b1/3156113eb6831c0f37d2525aa61991a03e7650e12b04132f6897f62f3f5b/python-netflix-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "4931cbc6cfd19d82d1559dfeb35ec6c3", "sha256": "6021da5f37aad095fe7851783766dab010c4ab21f6c92dd96663f6863eabb9c6" }, "downloads": -1, "filename": "python-netflix-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4931cbc6cfd19d82d1559dfeb35ec6c3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4533, "upload_time": "2012-07-09T17:15:07", "url": "https://files.pythonhosted.org/packages/71/cb/3af7a987614fca752aebe7b8a0da8792b6396739d2d7e951632c09e54fc2/python-netflix-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "c48e3936f7c1e233d0456b9b5e0cf5a9", "sha256": "df1720901c720f6368bf48cd4a21078e9c17371efdcb55ec56b46242497f4f81" }, "downloads": -1, "filename": "python-netflix-0.4.1.tar.gz", "has_sig": false, "md5_digest": "c48e3936f7c1e233d0456b9b5e0cf5a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4533, "upload_time": "2012-11-16T14:46:00", "url": "https://files.pythonhosted.org/packages/74/49/73b9250c0c53494b3433d0885f10d6b10b909bc00db122e060acadd0acd7/python-netflix-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c48e3936f7c1e233d0456b9b5e0cf5a9", "sha256": "df1720901c720f6368bf48cd4a21078e9c17371efdcb55ec56b46242497f4f81" }, "downloads": -1, "filename": "python-netflix-0.4.1.tar.gz", "has_sig": false, "md5_digest": "c48e3936f7c1e233d0456b9b5e0cf5a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4533, "upload_time": "2012-11-16T14:46:00", "url": "https://files.pythonhosted.org/packages/74/49/73b9250c0c53494b3433d0885f10d6b10b909bc00db122e060acadd0acd7/python-netflix-0.4.1.tar.gz" } ] }