{ "info": { "author": "Shaun Duncan", "author_email": "shaun.duncan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "giphypop\n========\n\n``giphypop`` is a wrapper around the Giphy_ api. It aims to provide a more\nintuitive, pythonic way for interacting with the Giphy_ api.\n\n.. image:: https://secure.travis-ci.org/shaunduncan/giphypop.png?branch=master\n :target: https://travis-ci.org/shaunduncan/giphypop\n\n\nRequirements, Installing, and Compatibility\n-------------------------------------------\n\nThe only requirement, included in ``requirements.txt`` is for requests_. If you\nare using pip, you can install ``giphypop``:\n\n.. code-block:: bash\n\n $ pip install requests giphypop\n\nAlternatively:\n\n.. code-block:: bash\n\n $ pip install requests\n $ pip install -e git+https://github.com/shaunduncan/giphypop.git#egg=giphypop\n\nThen you should be off and running. ``giphypop`` has been tested against python\nversions 2.6, 2.7, 3.2 and 3.3.\n\n\nGetting Started\n---------------\n\nUsing ``giphypop`` is straightforward and aims provide interaction with\nthe api without any regard to large bits of JSON. To get started, you\ncan test out various features using the include api key. You should be\nwarned, however, that while Giphy_ has been so kind as have a public\n\"testing\" key, it may be turned off in the future. See the `api docs`_\nfor more information.\n\nThe entry point for interacting with Giphy_ api is the ``giphypop.Giphy``\nclass. This class optionally accepts two arguments: ``api_key`` and ``strict``.\nThe ``api_key`` agument, when not preset, will default to the public key\n(see above). The ``strict`` argument controls how you expect the api to\nreact when no results are returned. If enabled, an exception is raised,\notherwise, ``None`` is returned.\n\n\n.. code-block:: python\n\n >>> import giphypop\n >>> g = giphypop.Giphy()\n\nNow you're ready to get started. There are a few key methods of the\n``giphypop.Giphy`` object that you'll want to know about\n\nsearch\n++++++\nSearch for gifs with a given word or phrase. Punctuation is ignored.\nBy default, this will perform a ``term`` search. If you want to search\nby phrase, use the ``phrase`` keyword argument. What's the difference\nbetween ``term`` and ``phrase`` searches? Simple: a term search will\nreturn results matching any words given, whereas a phrase search will\nmatch all words.\n\nNote that this method is a ``giphypop.GiphyImage`` generator that\nautomatically handles api paging. Optionally accepts a limit that will\nterminate the generation after a specified number of results have been\nyielded. This defaults to 25 results; a None implies no limit\n\n- **term**: Search term or terms, string\n- **phrase**: Search phrase, string\n- **limit**: Maximum number of results to yield, integer\n\nsearch_list\n+++++++++++\nSuppose you expect the ``search`` method to just give you a list rather\nthan a generator. This method will have that effect. Equivalent to:\n\n.. code-block:: python\n\n >>> g = giphypop.Giphy()\n >>> results = [x for x in g.search('foo')]\n\ntranslate\n+++++++++\nRetrieve a single image that represents a transalation of a term or\nphrase into an animated gif. Punctuation is ignored. By default, this\nwill perform a ``term`` translation. If you want to translate by phrase,\nuse the ``phrase`` keyword argument.\n\n- **term**: Search term or terms, string\n- **phrase**: Search phrase, string\n- **strict**: Whether an exception should be raised when no results, boolean\n\ngif\n+++\nRetrieves a specifc gif from giphy based on unique id\n\n- **gif_id**: Unique giphy gif ID, string\n- **strict**: Whether an exception should be raised when no results, boolean\n\nscreensaver\n+++++++++++\nReturns a random giphy image, optionally based on a search of a given tag.\nNote that this method will both query for a screensaver image and fetch the\nfull details of that image (2 request calls)\n\n- **tag**: Limit random gifs returned by a tag, string\n- **strict**: Whether an exception should be raised when no results, boolean\n\nrandom_gif\n++++++++++\nAn alias of ``giphypop.Giphy.screensaver``\n\nupload\n++++++\nUploads a video or gif to giphy. Once the upload has completed, requests the\nfull gif details and returns a GiphyImage (2 request calls).\n\n- **tags**: A list of tags to use on the uploaded gif, list\n- **file_path**: The path to the file to upload, string\n- **username**: The username of the account to upload to when using your own API key, string\n\n------------------------------------------------------------------------------\n\n.. note::\n The above methods of ``giphypop.Giphy`` are also exposed at the module\n level for your convenience. The only difference is that they also\n accept an ``api_key`` keyword argument. For example:\n\n .. code-block:: python\n\n >>> from giphypop import translate\n >>> img = translate('foo', api_key='bar')\n\n------------------------------------------------------------------------------\n\n\nHandling Results\n----------------\n\nAll results that represent a single image are wrapped in a\n``giphypop.GiphyImage`` object. This object acts like a dictionary, but\nalso exposes keys as attributes. Note, that these are **not** a direct\nmirror of api response objects; their goal is to be simpler. Structure\nfollows this layout::\n\n \n - id\n - type: image type (i.e. gif)\n - url: URL to giphy page\n - raw_data: copy of original data response from giphy (JSON)\n - fullscreen: bit.ly link to giphy fullscreen gif\n - tiled: bit.ly link to giphy tiled gif\n - bitly: bit.ly version of `url`\n - media_url: URL directly to image (original size)\n - frames: number of frames\n - height: image height (original image)\n - width: image width (original image)\n - size: filesize (in bytes, original image)\n - fixed_height: (variable width @ 200px height)\n - url: URL directly to image\n - width: image width\n - height: image height\n - downsampled:\n - url: URL directly to image\n - width: image width\n - height: image height\n - still: (a still image of gif)\n - url: URL directly to image\n - width: image width\n - height: image height\n - fixed_width: (variable height @ 200px width)\n - url: URL directly to image\n - width: image width\n - height: image height\n - downsampled:\n - url: URL directly to image\n - width: image width\n - height: image height\n - still: (a still image of gif)\n - url: URL directly to image\n - width: image width\n - height: image height\n\nFor example:\n\n.. code-block:: python\n\n >>> from giphypop import translate\n >>> img = translate('foo')\n >>> img.url\n 'http://giphy.com/foo/bar/baz'\n >>> img.width\n 200\n >>> img.fixed_height.downsampled.url\n 'http://giphy.com/foo/bar/downsampled'\n\n\nUploading\n---------\n\nThe Giphy API will accept uploads of gifs or videos. You are able to upload\nusing the public API key, but you won't be able to assign them to your username\nor delete them. In order to upload to your account, set the `username` when you\nand the API key when you upload.\n\nFor example:\n\n.. code-block:: python\n\n >>> from giphypop import upload\n >>> gif = upload([\"foo\", \"bar\"], \"mycat.gif\")\n >>> gif\n GiphyImage<26BRvG76mOYcvRxss> at http://giphy.com/gifs/bar-foo-26BRvG76mOYcvRxss\n\nOr using your own API key to upload to your own account:\n\n.. code-block:: python\n\n >>> from giphypop import upload\n >>> gif = upload([\"foo\", \"bar\"], \"mycat.gif\", username=\"gifsarefun\", api_key=\"abcdef12345678\")\n >>> gif\n GiphyImage<26BRvG76mOYcvRxss> at http://giphy.com/gifs/bar-foo-26BRvG76mOYcvRxss\n\n\nChangelog\n---------\n\n0.1\n+++\n\n- Initial Version\n\n\nContribution and License\n------------------------\n\nDeveloped by `Shaun Duncan`_ and is licensed under the terms of a MIT license.\nContributions are welcomed and appreciated!\n\n\n.. _Giphy: http://giphy.com\n.. _requests: https://pypi.python.org/pypi/requests/1.2.3\n.. _`api docs`: http://github.com/giphy/giphyapi\n.. _`Shaun Duncan`: shaun.duncan@gmail.com", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.github.com/shaunduncan/giphypop/", "keywords": "python giphy api", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "giphypop", "package_url": "https://pypi.org/project/giphypop/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/giphypop/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.github.com/shaunduncan/giphypop/" }, "release_url": "https://pypi.org/project/giphypop/0.3/", "requires_dist": null, "requires_python": null, "summary": "Python wrapper for Giphy API", "version": "0.3" }, "last_serial": 2556626, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "86a77c691446001712c5c1698024b82b", "sha256": "c9e2e6d628803933351f6101f1f608655d9fb65e1fae1fca12164530b1cc0812" }, "downloads": -1, "filename": "giphypop-0.1.tar.gz", "has_sig": false, "md5_digest": "86a77c691446001712c5c1698024b82b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8151, "upload_time": "2013-06-07T03:23:22", "url": "https://files.pythonhosted.org/packages/2d/ae/09acccd5f04db20cfb65c9efc23abe19caee7d971d30673dc102fe2a28a4/giphypop-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "5cbcd2fb8fcf140769d16b61c9524801", "sha256": "519d844b46210e5b3d7698bb3a427ee26b7c1628ee3f946075aab7e53d618296" }, "downloads": -1, "filename": "giphypop-0.2.tar.gz", "has_sig": false, "md5_digest": "5cbcd2fb8fcf140769d16b61c9524801", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8807, "upload_time": "2014-03-18T12:31:07", "url": "https://files.pythonhosted.org/packages/6e/f5/181d6ada0ea272393bc36a472a5e4918f7c7fb2d86b0d8dca2d1ea2aca06/giphypop-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "907eac5cee50260d0d119ff8f6458a90", "sha256": "8dbdffa520be21dff4f7415913c024bca100458fbb19aea878942cff4ab903f1" }, "downloads": -1, "filename": "giphypop-0.3.tar.gz", "has_sig": false, "md5_digest": "907eac5cee50260d0d119ff8f6458a90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10316, "upload_time": "2017-01-05T21:45:10", "url": "https://files.pythonhosted.org/packages/1c/05/cb5c653fe35677f61475af791459a736374883f9e749f55c7de1d29d2746/giphypop-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "907eac5cee50260d0d119ff8f6458a90", "sha256": "8dbdffa520be21dff4f7415913c024bca100458fbb19aea878942cff4ab903f1" }, "downloads": -1, "filename": "giphypop-0.3.tar.gz", "has_sig": false, "md5_digest": "907eac5cee50260d0d119ff8f6458a90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10316, "upload_time": "2017-01-05T21:45:10", "url": "https://files.pythonhosted.org/packages/1c/05/cb5c653fe35677f61475af791459a736374883f9e749f55c7de1d29d2746/giphypop-0.3.tar.gz" } ] }