{ "info": { "author": "Derrick Gilland", "author_email": "dgilland@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "yummly.py\r\n*********\r\n\r\n|version| |license|\r\n\r\nPython library for `Yummly API `_\r\n\r\n**NOTE:** This library and its author are not affliated with Yummly.\r\n\r\n\r\nInstallation\r\n============\r\n\r\n\r\n::\r\n\r\n pip install yummly\r\n\r\n\r\nDependencies\r\n============\r\n\r\n- requests >= 1.1.0\r\n\r\n\r\nUsage\r\n=====\r\n\r\nUse ``yummly.Client`` to create a client object to interact with the Yummly API.\r\n\r\nThe client accepts ``api_id``, ``api_key``, and ``timeout`` as init parameters:\r\n\r\n\r\n.. code-block:: python\r\n\r\n from yummly import Client\r\n\r\n # default option values\r\n TIMEOUT = 5.0\r\n RETRIES = 0\r\n\r\n client = Client(api_id=YOUR_API_ID, api_key=YOUR_API_KEY, timeout=TIMEOUT, retries=RETRIES)\r\n\r\n search = client.search('green eggs and ham')\r\n match = search.matches[0]\r\n\r\n recipe = client.recipe(match.id)\r\n\r\n\r\nSearch Recipes\r\n--------------\r\n\r\nAPI endpoint: ``api.yummly.com/v1/api/recipes?``\r\n\r\nSearch for recipes meeting certain criteria:\r\n\r\n\r\n.. code-block:: python\r\n\r\n results = yummly.search('bacon')\r\n\r\n print('Total Matches:', results.totalMatchCount)\r\n for match in results.matches:\r\n print('Recipe ID:', match.id)\r\n print('Recipe:', match.recipeName)\r\n print('Rating:', match.rating)\r\n print('Total Time (mins):', match.totalTimeInSeconds / 60.0)\r\n print('----------------------------------------------------')\r\n\r\n\r\nLimit your results to a maximum:\r\n\r\n\r\n.. code-block:: python\r\n\r\n # return the first 10 results\r\n results = yummly.search('chicken marsala', maxResults=10)\r\n\r\n\r\nOffset the results for pagination:\r\n\r\n\r\n.. code-block:: python\r\n\r\n # return 2nd page of results\r\n results = yummly.search('pulled pork', maxResults=10, start=10)\r\n\r\n\r\nProvide search parameters:\r\n\r\n\r\n.. code-block:: python\r\n\r\n params = {\r\n 'q': 'pork chops',\r\n 'start': 0,\r\n 'maxResult': 40,\r\n 'requirePicutres': True,\r\n 'allowedIngredient[]': ['salt', 'pepper'],\r\n 'excludedIngredient[]': ['cumin', 'paprika'],\r\n 'maxTotalTimeInSeconds': 3600,\r\n 'facetField[]': ['ingredient', 'diet'],\r\n 'flavor.meaty.min': 0.5,\r\n 'flavor.meaty.max': 1,\r\n 'flavor.sweet.min': 0,\r\n 'flavor.sweet.max': 0.5,\r\n 'nutrition.FAT.min': 0,\r\n 'nutrition.FAT.max': 15\r\n }\r\n\r\n results = yummly.search(**params)\r\n\r\n\r\nFor a full list of supported search parameters, see section *The Search Recipes Call* located at: https://developer.yummly.com/intro\r\n\r\nExample search response: https://developer.yummly.com/wiki/search-recipes-response-sample\r\n\r\n\r\nGet Recipe\r\n----------\r\n\r\nAPI endpoint: ``api.yummly.com/v1/api/recipe/``\r\n\r\nFetch a recipe by its recipe ID:\r\n\r\n\r\n.. code-block:: python\r\n\r\n recipe = yummly.recipe(recipe_id)\r\n\r\n print('Recipe ID:', recipe.id)\r\n print('Recipe:', recipe.name)\r\n print('Rating:', recipe.rating)\r\n print('Total Time:', recipe.totalTime)\r\n print('Yields:', recipe.yields)\r\n print('Ingredients:')\r\n for ingred in recipe.ingredientLines:\r\n print(ingred)\r\n\r\n\r\nExample recipe response: https://developer.yummly.com/wiki/get-recipe-response-sample\r\n\r\n**NOTE:** Yummly's Get-Recipe response includes ``yield`` as a field name. However, ``yield`` is a keyword in Python so this has been renamed to ``yields``.\r\n\r\n\r\nSearch metadata\r\n---------------\r\n\r\nAPI endpoint: ``api.yummly.com/v1/api/metadata/``\r\n\r\nYummly provides a metadata endpoint that returns the possible values for allowed/excluded ingredient, diet, allergy, and other search parameters:\r\n\r\n\r\n.. code-block:: python\r\n\r\n METADATA_KEYS = [\r\n 'ingredient',\r\n 'holiday',\r\n 'diet',\r\n 'allergy',\r\n 'technique',\r\n 'cuisine',\r\n 'course',\r\n 'source',\r\n 'brand',\r\n 'restriction'\r\n ]\r\n\r\n ingredients = client.metadata('ingredient')\r\n diets = client.metadata('diet')\r\n sources = client.metadata('source')\r\n\r\n\r\n**NOTE:** Yummly's raw API returns this data as a JSONP response which ``yummly.py`` parses off and then converts to a ``list`` containing instances of the corresponding metadata class.\r\n\r\n\r\nAPI Model Classes\r\n=================\r\n\r\nAll underlying API model classes are in ``yummly/models.py``. The base class used for all models is a modified ``dict`` class with attribute-style access (i.e. both ``obj.foo`` and ``obj['foo']`` are valid accessor methods).\r\n\r\nA derived ``dict`` class was chosen to accommodate painless conversion to JSON which is a fairly common requirement when using ``yummly.py`` as an API proxy to feed your applications (e.g. a web app with ``yummly.py`` running on your server instead of directly using the Yummly API on the frontend).\r\n\r\n\r\nTesting\r\n=======\r\n\r\nTests are located in ``tests/``. They can be executed using ``pytest`` from the root directory using ``makefile`` or ``pytest``.\r\n\r\n\r\n::\r\n\r\n # using makefile\r\n make test\r\n\r\n # using pytest directly\r\n py.test yummly\r\n\r\n\r\n**NOTE:** Running the test suite will use real API calls which will count against your call limit. Currently, 22 API calls are made when running the tests.\r\n\r\n\r\nTest Config File\r\n----------------\r\n\r\nA test config file is required to run the tests. Create ``tests/config.json`` with the following properties:\r\n\r\n.. code-block:: javascript\r\n\r\n {\r\n \"api_id\": \"YOUR_API_ID\",\r\n \"api_key\": \"YOUR_API_KEY\"\r\n }\r\n\r\n\r\nThis file will be loaded automatically when the tests are run.\r\n\r\n\r\nLicense\r\n=======\r\n\r\nThis software is licensed under the MIT License.\r\n\r\n\r\nTODO\r\n====\r\n\r\n- Provide helpers for complex search parameters like nutrition, flavors, and metadata\r\n\r\n\r\n.. |version| image:: https://img.shields.io/pypi/v/yummly.svg?style=flat\r\n :target: https://pypi.python.org/pypi/yummly/\r\n\r\n.. |license| image:: https://img.shields.io/pypi/l/yummly.svg?style=flat\r\n :target: https://pypi.python.org/pypi/yummly/", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dgilland/yummly.py", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "yummly", "package_url": "https://pypi.org/project/yummly/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/yummly/", "project_urls": { "Homepage": "https://github.com/dgilland/yummly.py" }, "release_url": "https://pypi.org/project/yummly/0.5.0/", "requires_dist": [ "requests (>=1.1.0)" ], "requires_python": null, "summary": "Python library for Yummly API: https://developer.yummly.com", "version": "0.5.0" }, "last_serial": 1621357, "releases": { "0.3.1": [ { "comment_text": "", "digests": { "md5": "7024475fe3f6a686d348f794bea69dfa", "sha256": "5b8b130e14bb0d492af845c82c63f77129dbba566e05cc6762b7990dd5aee43e" }, "downloads": -1, "filename": "yummly-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7024475fe3f6a686d348f794bea69dfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12719, "upload_time": "2013-02-02T23:07:56", "url": "https://files.pythonhosted.org/packages/b2/e3/d8f639866c79cd465eeba10f36381121ff0ce093f0bdbb96dbfda35ab2ad/yummly-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "fea8afdbaa184c926541d27d55505c13", "sha256": "957b57cb146b2978c2e563219c32b9ebc54419157089482645b51edd71cad300" }, "downloads": -1, "filename": "yummly-0.3.2.tar.gz", "has_sig": false, "md5_digest": "fea8afdbaa184c926541d27d55505c13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12778, "upload_time": "2013-02-02T23:13:16", "url": "https://files.pythonhosted.org/packages/f8/5f/a73f4c5b1560861960c149a85459232ffe2a25bdf854f0f2ab22f155e44d/yummly-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "73864d7fbf594549fb457c1145732a00", "sha256": "69dca2249e228a2a41aaefa1230880136a97eaf101bc61ec21b3fb27773c35bd" }, "downloads": -1, "filename": "yummly-0.3.3.tar.gz", "has_sig": false, "md5_digest": "73864d7fbf594549fb457c1145732a00", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12761, "upload_time": "2013-02-02T23:28:26", "url": "https://files.pythonhosted.org/packages/98/0a/2c4d4c6a6220c4d72124679897f426fa9758e36d0e0286e945973d9cce4f/yummly-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "3efbf57aa30c32830eb437aa74a96a29", "sha256": "310a3ef13354c77464de6bb6d4bd8f88f74aee0a4b7ba814996351adbc6fee53" }, "downloads": -1, "filename": "yummly-0.3.4.tar.gz", "has_sig": false, "md5_digest": "3efbf57aa30c32830eb437aa74a96a29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13098, "upload_time": "2013-02-03T23:50:04", "url": "https://files.pythonhosted.org/packages/25/b8/b7b0e26fd9126a23549913878fcac3877263e197760834698572ecbc9632/yummly-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "23c044d3218db87efd520d4fe06cfb9c", "sha256": "7748a71f2e6852031fed1db6a83204295a9f06853c7fb2b47207ed121d515c6c" }, "downloads": -1, "filename": "yummly-0.3.5.tar.gz", "has_sig": false, "md5_digest": "23c044d3218db87efd520d4fe06cfb9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13195, "upload_time": "2013-03-12T19:06:30", "url": "https://files.pythonhosted.org/packages/96/0d/4933115becd11ebf07aca2d3a52a4b4dfc458913987a307c98bf106122e5/yummly-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "fc21fcc51a22cf6abc924a0aaffe6a8f", "sha256": "77c7cb71da196f0d48b7ad9df41e6ddbf8f1e5ae38b636e77f2f664203d5caa3" }, "downloads": -1, "filename": "yummly-0.3.6.tar.gz", "has_sig": false, "md5_digest": "fc21fcc51a22cf6abc924a0aaffe6a8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13377, "upload_time": "2013-04-02T12:43:52", "url": "https://files.pythonhosted.org/packages/42/b0/8ffa68a6ff8b0640268c3265b2d2d3c6932329c82693bd5bd0e5fccb5d4d/yummly-0.3.6.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "48e32ccc9b13c3112d4154501f1da61d", "sha256": "ca8821a9faf049bc7989b056a3ffe0eeb778231bb83e44f51791f8e3a0b69bb5" }, "downloads": -1, "filename": "yummly-0.4.0.tar.gz", "has_sig": false, "md5_digest": "48e32ccc9b13c3112d4154501f1da61d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11211, "upload_time": "2013-09-10T04:31:23", "url": "https://files.pythonhosted.org/packages/18/1b/ec1921fd82903806838d535abd9adfbaa9319d2739fee229cb86a210e81d/yummly-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "7c427a5fca5f0a95c5730b425fbb3154", "sha256": "1773e6f38631ec0496c6b2e4e46c6613ffdbe7d62faf0089bf5ec97ea1c50fed" }, "downloads": -1, "filename": "yummly-0.4.1.tar.gz", "has_sig": false, "md5_digest": "7c427a5fca5f0a95c5730b425fbb3154", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8563, "upload_time": "2014-11-22T14:28:38", "url": "https://files.pythonhosted.org/packages/3c/da/646c1d17bc1ac3086c143c71048415ba5221f28ef037faad9d73a55bfb24/yummly-0.4.1.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "bc6272ebfb9a8846d183098dc2fef9a4", "sha256": "b7677348ff95191e2ff047113fef91c2a8e401e4ef1cd5cc4220367b0bcf2ff4" }, "downloads": -1, "filename": "yummly-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bc6272ebfb9a8846d183098dc2fef9a4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11388, "upload_time": "2014-12-17T01:42:15", "url": "https://files.pythonhosted.org/packages/43/66/a7112392f94826d3abb361ca3316585e9a6ccd445690e7e00b60e05d9dee/yummly-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f6632396a08debf34c4f3daa0a7b8c1e", "sha256": "70c7583800670a77345efa517da335286dbaeeaaa1bf48bca13e76270674b9ac" }, "downloads": -1, "filename": "yummly-0.5.0.tar.gz", "has_sig": false, "md5_digest": "f6632396a08debf34c4f3daa0a7b8c1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8900, "upload_time": "2014-12-17T01:42:18", "url": "https://files.pythonhosted.org/packages/61/63/a42d6b89f475a6a41235b6600a15c302e72717704a10f0a2b948311f1c12/yummly-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bc6272ebfb9a8846d183098dc2fef9a4", "sha256": "b7677348ff95191e2ff047113fef91c2a8e401e4ef1cd5cc4220367b0bcf2ff4" }, "downloads": -1, "filename": "yummly-0.5.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bc6272ebfb9a8846d183098dc2fef9a4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11388, "upload_time": "2014-12-17T01:42:15", "url": "https://files.pythonhosted.org/packages/43/66/a7112392f94826d3abb361ca3316585e9a6ccd445690e7e00b60e05d9dee/yummly-0.5.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f6632396a08debf34c4f3daa0a7b8c1e", "sha256": "70c7583800670a77345efa517da335286dbaeeaaa1bf48bca13e76270674b9ac" }, "downloads": -1, "filename": "yummly-0.5.0.tar.gz", "has_sig": false, "md5_digest": "f6632396a08debf34c4f3daa0a7b8c1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8900, "upload_time": "2014-12-17T01:42:18", "url": "https://files.pythonhosted.org/packages/61/63/a42d6b89f475a6a41235b6600a15c302e72717704a10f0a2b948311f1c12/yummly-0.5.0.tar.gz" } ] }