{ "info": { "author": "Mike Helmick", "author_email": "me@michaelhelmick.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-Flickr\n=============\n\nPython-Flickr is A Python library to interface with `Flickr REST API `_ & OAuth\n\nFeatures\n--------\n\n* Photo Uploading\n* Retrieve user information\n* Common Flickr methods\n - Add/edit/delete comments\n - Add/edit/delete notes\n - And many more (very dynamic library)!!\n* All responses return as nice dicts\n\nInstallation\n------------\n\nInstalling Python-Flickr is simple: ::\n\n $ pip install python-flickr\n\nUsage\n-----\n\nAuthorization URL\n~~~~~~~~~~~~~~~~~\n::\n\n f = FlickrAPI(api_key='*your app key*',\n api_secret='*your app secret*',\n callback_url='http://www.example.com/callback/')\n\n auth_props = f.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 = auth_props['oauth_token']\n oauth_token_secret = auth_props['oauth_token_secret']\n\n print 'Connect with Flickr 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\n\nHandling the Callback\n~~~~~~~~~~~~~~~~~~~~~\n::\n\n # oauth_token and oauth_token_secret come from the previous step\n # if needed, store those in a session variable or something\n\n f = FlickrAPI(api_key='*your app key*',\n api_secret='*your app secret*',\n oauth_token=oauth_token,\n oauth_token_secret=oauth_token_secret)\n\n authorized_tokens = f.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\n # Save those tokens to the database for a later use?\n\n\nGetting the Users recent activity feed\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n::\n\n # Get the final tokens from the database or wherever you have them stored\n\n f = FlickrAPI(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 recent_activity = f.get('flickr.activity.userComments')\n print recent_activity\n\n\nAdd comment on a photo\n~~~~~~~~~~~~~~~~~~~~~~\n::\n\n # Assume you are using the FlickrAPI instance from the previous section\n\n add_comment = f.post('flickr.photos.comments.addComment',\n params={'photo_id': '6620847285', 'comment_text': 'This is a test comment.'})\n\n #This returns the comment id if successful.\n print add_comment\n\n\nRemove comment on a photo\n~~~~~~~~~~~~~~~~~~~~~~~~~\n::\n\n # Assume you are using the FlickrAPI instance from the previous section\n # If the comment is already deleted, it will throw a FlickrAPIError (In this case, with code 2: Comment not found.)\n\n del_comment = f.post('flickr.photos.comments.deleteComment', params={'comment_id':'45887890-6620847285-72157628767110559'})\n print del_comment\n\n\nUpload a photo\n~~~~~~~~~~~~~~\n::\n\n # Assume you are using the FlickrAPI instance from the previous section\n\n files = open('/path/to/file/image.jpg', 'rb')\n add_photo = f.post(params={'title':'Test Title!'}, files=files)\n\n print add_photo # Returns the photo id of the newly added photo\n\n\nCatching errors\n~~~~~~~~~~~~~~~\n::\n\n # Assume you are using the FlickrAPI instance from the previous section\n\n try:\n # This comment was already deleted\n del_comment = f.post('flickr.photos.comments.deleteComment', params={'comment_id':'45887890-6620847285-72157628767110559'})\n except FlickrAPIError, e:\n print e.msg\n print e.code\n print 'Something bad happened :('", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/michaelhelmick/python-flickr/zipball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michaelhelmick/python-flickr/", "keywords": "python flickr oauth api", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "python-flickr", "package_url": "https://pypi.org/project/python-flickr/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-flickr/", "project_urls": { "Download": "https://github.com/michaelhelmick/python-flickr/zipball/master", "Homepage": "https://github.com/michaelhelmick/python-flickr/" }, "release_url": "https://pypi.org/project/python-flickr/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "A Python Library to interface with Flickr REST API, OAuth & JSON Responses", "version": "0.3.2" }, "last_serial": 1117590, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b858f9db18c4a5facd9165d958d929d0", "sha256": "7bd1139be5cde347259962c840dac19a9dd471b71722d872c3f33c6ddcab7ab3" }, "downloads": -1, "filename": "python-flickr-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b858f9db18c4a5facd9165d958d929d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5119, "upload_time": "2012-02-02T04:52:35", "url": "https://files.pythonhosted.org/packages/94/a5/f6b2184dc179d0e88488a43c3b1c1cccc1169242622c14c4e8c1e72a234e/python-flickr-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "01335aec180588049603a85b87ceaeed", "sha256": "6850e6832f1b0f9a52858cd19dad890bd8850b7a2f176ce5d39a25f79097ea8c" }, "downloads": -1, "filename": "python-flickr-0.1.1.tar.gz", "has_sig": false, "md5_digest": "01335aec180588049603a85b87ceaeed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5124, "upload_time": "2012-02-02T05:11:09", "url": "https://files.pythonhosted.org/packages/d5/0c/b6d92c411e882143a6800e33860e34eefb7c261c73b80c47b84dfd965fee/python-flickr-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2ab4903a719bd091f0dd7be3b5ae731c", "sha256": "8f130dc9a604b27b93480b5ea803ecce412cdf9726abe14ebe5af7b2c6139cb6" }, "downloads": -1, "filename": "python-flickr-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2ab4903a719bd091f0dd7be3b5ae731c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6512, "upload_time": "2012-04-17T19:45:47", "url": "https://files.pythonhosted.org/packages/fa/bb/dd8559383a2726cf1c471cff5c2b303013da89eb8fcce346936a9edbf4c0/python-flickr-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "75aff2f3ef5cf61b8dad8accb5f81281", "sha256": "8cff69960cacdef7f918d3e111c189fdb8e490222dc524a3d9d1b9f7ead24bb4" }, "downloads": -1, "filename": "python-flickr-0.3.0.tar.gz", "has_sig": false, "md5_digest": "75aff2f3ef5cf61b8dad8accb5f81281", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6705, "upload_time": "2012-08-10T17:12:12", "url": "https://files.pythonhosted.org/packages/c7/ff/39f7b20cfa1b30e18f268cbb7daa6779a571ac2a2ae676b587a301f9322d/python-flickr-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "a2a3ee55b5969e20a5570b4aed52a780", "sha256": "9d9b629884ca1941fd54b19508f6e62e3419cde8f8c0c5fe6075af5237f9ced1" }, "downloads": -1, "filename": "python-flickr-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a2a3ee55b5969e20a5570b4aed52a780", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6672, "upload_time": "2014-04-07T14:40:41", "url": "https://files.pythonhosted.org/packages/fc/1c/6b5d97f7264993af8d28e11a9fdd663d9fed68e7dff5039e93faa5cf5b26/python-flickr-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "d261a495735b419cf952d0d66e3a91b2", "sha256": "597962bb072d47b7b396cd999f37611fea33da02f14a168e7e3726fc7c12320a" }, "downloads": -1, "filename": "python-flickr-0.3.2.tar.gz", "has_sig": false, "md5_digest": "d261a495735b419cf952d0d66e3a91b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6703, "upload_time": "2014-06-07T15:38:22", "url": "https://files.pythonhosted.org/packages/70/75/832a2c70df7b8b1c22d96cdf3df9bb801010b446ec2e8dd7cae3bb55e59a/python-flickr-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d261a495735b419cf952d0d66e3a91b2", "sha256": "597962bb072d47b7b396cd999f37611fea33da02f14a168e7e3726fc7c12320a" }, "downloads": -1, "filename": "python-flickr-0.3.2.tar.gz", "has_sig": false, "md5_digest": "d261a495735b419cf952d0d66e3a91b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6703, "upload_time": "2014-06-07T15:38:22", "url": "https://files.pythonhosted.org/packages/70/75/832a2c70df7b8b1c22d96cdf3df9bb801010b446ec2e8dd7cae3bb55e59a/python-flickr-0.3.2.tar.gz" } ] }