Skip to main content

A Python wrapper for the Spoonacular API

Project description

🥄 spoonacular 🥄


Build Status PyPI version Python version

Want to parse a list of ingredients within a recipe? Or are you looking for a random food joke? These are just two of many endpoints provided by the marvelous Spoonacular food and recipes API. spoonacular provides a simple Python interface to this API.

Installation

The easiest way to start using this package is to install it via PyPI using pip:

$pip install spoonacular

Thank you to @sebbekarlsson for transferring ownership of the original PyPI package name.

If you'd prefer to clone and install the repository manually, follow these steps:

  1. Clone this repo: $git clone https://github.com/johnwmillr/SpoonacularAPI.git
  2. Enter the cloned directory: $cd SpoonacularAPI
  3. Install: $python setup.py install

Usage

API Key

You'll need to sign up for an account on RapidAPI to start using spoonacular. Spoonacular is a freemium API, so you'll be able to start with 50 free calls a day. Registration requires a credit card number even for the free plan, because users are charged a small amount per call if they go over the daily limit. This package has a basic system in place to try and prevent overrage charges.

Examples

import spoonacular as sp
api = sp.API("your_api_key_here")

# Parse an ingredient
response = api.parse_ingredients("3.5 cups King Arthur flour", servings=1)
data = response.json()
print(data[0]['name'])
>>>"flour"

# Detect text for mentions of food
response = api.detect_food_in_text("I really want a cheeseburger.")
data = response.json()
print(data['annotations'][0])
>>>{"annotation": "cheeseburger", "tag":"dish"}

# Get a random food joke
response = api.get_a_random_food_joke()
data = response.json()
print(data['text'])
>>>"People are a lot less judgy when you say you ate an 'avocado salad' instead of a bowl of guacamole."

Documentation

Collaboration

Please feel free to collaborate with a pull request or by opening an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spoonacular-2.2.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spoonacular-2.2.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file spoonacular-2.2.1.tar.gz.

File metadata

  • Download URL: spoonacular-2.2.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.15

File hashes

Hashes for spoonacular-2.2.1.tar.gz
Algorithm Hash digest
SHA256 da77fd0acb443b6f1e442a3713637115f65aa448a39ab97eee2f7b624095a39c
MD5 3f353909a03a06b870bb08b3e0d4e0bc
BLAKE2b-256 97c433cbcfe00b067bdcf0f19c867e113df0a8bb4501de2158b799ed74226f91

See more details on using hashes here.

File details

Details for the file spoonacular-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: spoonacular-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.15

File hashes

Hashes for spoonacular-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f220069dfd78c9f3dd8e6ba8716e7edf18a7c72d65b950bff80d2ebc09251d
MD5 953b2b73f8a191f942a47921f664a4be
BLAKE2b-256 bbe5f1561656055601f10dd6158066c5a9df35dcf930daca37a15b26a9825013

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page