Python SDK for working with recipes from JSON files. Includes 4819+ validated recipes across breakfast, lunch, dinner, and snack categories.
Project description
Recipes SDK
Python SDK for working with recipes from JSON files.
Installation
pip install -r requirements.txt
Usage
from recipes_sdk import RecipesSDK
import json
# Create SDK instance
sdk = RecipesSDK(language="en") # or "ru"
# Random recipe
recipe_json = sdk.get_random_recipe()
recipe = json.loads(recipe_json)
# With allergens and calories filtering
recipe_json = sdk.get_random_recipe(
user_allergens=["nuts", "gluten"],
max_calories=300
)
recipe = json.loads(recipe_json)
# Get all recipes by category
breakfast_json = sdk.get_recipes_by_category("breakfast")
breakfast_recipes = json.loads(breakfast_json)
# Get random recipe from category
random_breakfast_json = sdk.get_random_recipe_by_category("breakfast")
random_breakfast = json.loads(random_breakfast_json)
API
get_random_recipe(user_allergens=None, max_calories=None)- random recipe from all categories (returns JSON string)get_recipes_by_category(category, user_allergens=None, max_calories=None)- all recipes from category (returns JSON string)get_random_recipe_by_category(category, user_allergens=None, max_calories=None)- random recipe from category (returns JSON string)get_all_categories()- list of available categories (returns JSON string)get_all_recipes(user_allergens=None, max_calories=None)- all recipes from all categories (returns JSON string)
All methods support filtering by allergens and calories.
Categories
breakfast- breakfast recipes (loaded from breakfast_1.json, breakfast_2.json, breakfast_3.json, breakfast_4.json)lunch- lunch recipes (loaded from lunch.json, lunch_1.json)dinner- dinner recipes (loaded from dinner.json, dinner_1.json)snack- snack recipes (loaded from snack.json)
SDK automatically loads all available files for each category.
Recipe Format
Each recipe contains:
id- unique identifiername- object withruandenfieldscalories,protein,fat,carbs- nutritional informationtotal_g- total weight in gramsrecipe- cooking instructions withruandenfieldsallergens- list of allergens withruandenfieldsis_pp- boolean flagprep_time- preparation time withruandenfieldsingredients_details- detailed ingredients list withruandenfieldstips- cooking tips withruandenfields
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file recipes_sdk-0.3.0.tar.gz.
File metadata
- Download URL: recipes_sdk-0.3.0.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9099dcc4b305094ba55328062c00d0c989a95bd302331ca1aaa06f92007ad0e
|
|
| MD5 |
f40cb8ef9758715c44edf6cfefa18e53
|
|
| BLAKE2b-256 |
9d40b94b33e918a9e3290dda2fc1abac50ab12fc6ee78ea76616e6c54c311349
|
File details
Details for the file recipes_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: recipes_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca2fd0f921fe00581e1e349cdcaa8692dde5f58e0b0d424a5decda1f58cd0f55
|
|
| MD5 |
efd8191a18cccf8d1ebe7c5e7cf6f134
|
|
| BLAKE2b-256 |
8c82f06122bbb95b00508644e4b739554137afaed2fb2e3b9d5211276780ccf0
|