{ "info": { "author": "Andreas Damgaard Pedersen", "author_email": "andreas.damgaard.pedersen@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Utilities" ], "description": ".. begin_intro\n\nPyImgur\n=======\n\n.. image:: https://badge.fury.io/py/pyimgur.svg\n :target: https://badge.fury.io/py/pyimgur\n\nThe simple way of using Imgur.\n\nYou can upload images, download images, read comments, update your albums,\nmessage people and more. In fact, you can do almost everything via PyImgur that\nyou can via the webend.\n\n.. end_intro\n\n.. begin_installation\n\nInstallation\n------------\n\nThe recommended way to install is via `pip `_\n\n.. code-block:: bash\n\n $ pip install pyimgur\n\n.. end_installation\n\n.. begin_getting_started\n\nGetting Started\n---------------\n\nBefore we can start using PyImgur, we need to register our application with\nImgur. This way, Imgur can see what each application is doing on their site.\nGo to https://api.imgur.com/oauth2/addclient to register your client. Note that\nyou can't use an application registration for the old v2 version of the Imgur\nAPI, which was depreciated December 2012.\n\nWhen we registered our application we got a ``client_id`` and a\n``client_secret``. The ``client_secret`` is used for authenticating as a user,\nif we just need access to public or anonymous resources, then we can leave it\nout. For our first example we're going to get some information about an image\nalready uploaded to image::\n\n import pyimgur\n CLIENT_ID = \"Your_applications_client_id\"\n im = pyimgur.Imgur(CLIENT_ID)\n image = im.get_image('S1jmapR')\n print(image.title) # Cat Ying & Yang\n print(image.link) # http://imgur.com/S1jmapR.jpg\n\nThe ``Imgur`` object keeps the authentication information, changes\nauthentication and is the common way to get objects from Imgur.\n\nUploading an Image\n------------------\n\nLet's use another example to show how to upload an image::\n\n import pyimgur\n\n CLIENT_ID = \"Your_applications_client_id\"\n PATH = \"A Filepath to an image on your computer\"\n\n im = pyimgur.Imgur(CLIENT_ID)\n uploaded_image = im.upload_image(PATH, title=\"Uploaded with PyImgur\")\n print(uploaded_image.title)\n print(uploaded_image.link)\n print(uploaded_image.size)\n print(uploaded_image.type)\n\n\nSome methods here one or more arguments with the default value ``None``. For\nmethods modifying existing objects, this mean to keep the already existing\nvalue. For methods not modifying existing objects, this mean to use the Imgur\ndefault.\n\nLazy objects\n------------\n\nTo reduce the load on Imgur, PyImgur only requests the data it needs. This\nmeans each object has the attribute ``_has_fetched`` which if ``True``` has\nfetched all the data it can, if ``False`` it can fetch more information.\n\nWhenever we request an attribute that hasn't been loaded the newest information\nwill be requested from Imgur and all the object attributes will be updated to\nthe newest values. We can also use the method ``refresh()`` to force a call to\nImgur, that will update the object with the latest values::\n\n import pyimgur\n CLIENT_ID = \"Your_applications_client_id\"\n im = pyimgur.Imgur(CLIENT_ID)\n gallery_image = im.get_gallery_image('JiAaT')\n author = gallery_image.author\n print(author._has_fetched) # False ie. it's a lazily loaded object\n print(author.reputation)\n print(author._has_fetched) # True ie. all values have now been retrieved.\n\nIntrospection\n-------------\n\nRemember that as usual you can use the ``dir``, ``vars`` and ``help`` builtin\nfunctions to introspect objects to learn more about them and how they work.\n\nMashape API\n-----------\n\nImgur supports commercial use via Mashape, which uses a different endpoint and\nsome additional authentication. You can enable this easily by providing your\nMashape key on initialization of the Imgur object::\n\n import pyimgur\n CLIENT_ID = \"Your_applications_client_id\"\n MASHAPE_KEY = \"Your_mashape_api_key\"\n im = pyimgur.Imgur(CLIENT_ID, mashape_key=MASHAPE_KEY)\n\nMore information on Mashape's API and Pricing can be found on the `Mashape\nwebsite `_.\n\nSupport\n-------\n\nIf you find an bug, have any questions about how to use PyImgur or have\nsuggestions for improvements then feel free to file an issue on the `Github\nproject page `_.\n\nDocumentation\n-------------\n\nPyImgur's full documentation is located on `ReadTheDocs\n`_.\n\nLicense\n-------\n\nAll of the code contained here is licensed by\n`the GNU GPLv3 `_.\n\n.. end_getting_started\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/Damgaard/PyImgur", "keywords": "imgur api wrapper PyImgur", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "ppyimgur", "package_url": "https://pypi.org/project/ppyimgur/", "platform": "", "project_url": "https://pypi.org/project/ppyimgur/", "project_urls": { "Homepage": "https://github.com/Damgaard/PyImgur" }, "release_url": "https://pypi.org/project/ppyimgur/0.6.0.post1/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "The easy way of using Imgur.", "version": "0.6.0.post1" }, "last_serial": 3928096, "releases": { "0.6.0.post1": [ { "comment_text": "", "digests": { "md5": "b61ee623532900540132e7a560d9ac4d", "sha256": "deb7be03a75450704532135cb874a5d4c76cc94b9d2f391f35994d5e3a09c9fb" }, "downloads": -1, "filename": "ppyimgur-0.6.0.post1-py3-none-any.whl", "has_sig": false, "md5_digest": "b61ee623532900540132e7a560d9ac4d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20271, "upload_time": "2018-06-04T13:42:32", "url": "https://files.pythonhosted.org/packages/50/87/7249b156cd7b925e78c0cd1fb39533f3af9dfb276590e1345fc5d9c43168/ppyimgur-0.6.0.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a9801c163345d4a4453ff65c98cf5f62", "sha256": "ad7352356696a72ee408e4cb0de08410f49617e74db340e6a7f733e2a8b5b99a" }, "downloads": -1, "filename": "ppyimgur-0.6.0.post1.tar.gz", "has_sig": false, "md5_digest": "a9801c163345d4a4453ff65c98cf5f62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32965, "upload_time": "2018-06-04T13:42:34", "url": "https://files.pythonhosted.org/packages/b3/25/b4116e2efcb28b637cd347e26ae534c0510682a87cddf9574c0bfd809d28/ppyimgur-0.6.0.post1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b61ee623532900540132e7a560d9ac4d", "sha256": "deb7be03a75450704532135cb874a5d4c76cc94b9d2f391f35994d5e3a09c9fb" }, "downloads": -1, "filename": "ppyimgur-0.6.0.post1-py3-none-any.whl", "has_sig": false, "md5_digest": "b61ee623532900540132e7a560d9ac4d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 20271, "upload_time": "2018-06-04T13:42:32", "url": "https://files.pythonhosted.org/packages/50/87/7249b156cd7b925e78c0cd1fb39533f3af9dfb276590e1345fc5d9c43168/ppyimgur-0.6.0.post1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a9801c163345d4a4453ff65c98cf5f62", "sha256": "ad7352356696a72ee408e4cb0de08410f49617e74db340e6a7f733e2a8b5b99a" }, "downloads": -1, "filename": "ppyimgur-0.6.0.post1.tar.gz", "has_sig": false, "md5_digest": "a9801c163345d4a4453ff65c98cf5f62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32965, "upload_time": "2018-06-04T13:42:34", "url": "https://files.pythonhosted.org/packages/b3/25/b4116e2efcb28b637cd347e26ae534c0510682a87cddf9574c0bfd809d28/ppyimgur-0.6.0.post1.tar.gz" } ] }