🥄 spoonacular 🥄
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:
- Clone this repo:
$git clone https://github.com/johnwmillr/SpoonacularAPI.git - Enter the cloned directory:
$cd SpoonacularAPI - 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.
Release files for spoonacular 3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spoonacular-3.0.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spoonacular-3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / spoonacular-3.0.tar.gz
| Download URL | spoonacular-3.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0e7f12d84342a79bf313f1c6385175f6651771d2de7381d06430a1c4b678241
|
|
BLAKE2b-256 checksum How to use checksums |
ff21541150521dc25fdfd8f10bcbcf6d6b227b2ed30ae1244c15320a375b39d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Release files / spoonacular-3.0-py3-none-any.whl
| Download URL | spoonacular-3.0-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b655241d8c85bcf8ccf6b0d6c0c6279c5cba74760965275989e93d820fdac1f7
|
|
BLAKE2b-256 checksum How to use checksums |
188331f74bf9452a597b545db89a7a2e172c7c24be3948b3657fb582c26cc43d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|