Recipe Database
Recipe Name ↕ | Category ↕ | Difficulty ↕ | Prep Time ↕ | Cook Time ↕ | Total Time ↕ |
---|
Database Schema
The recipe database uses the following schema:
recipes
├── id (PRIMARY KEY)
├── title
├── description
├── file_path
├── language
├── category
├── difficulty
├── prep_time
├── cook_time
├── total_time
├── servings
└── created_at
ingredients
├── id (PRIMARY KEY)
├── recipe_id (FOREIGN KEY -> recipes.id)
├── category
└── ingredient
instructions
├── id (PRIMARY KEY)
├── recipe_id (FOREIGN KEY -> recipes.id)
├── phase
├── step_number
└── instruction
storage_tips, serving_suggestions, recipe_notes
├── id (PRIMARY KEY)
├── recipe_id (FOREIGN KEY -> recipes.id)
└── text
Using the Database
If you want to use the recipe database in Python, you can do so with the following code:
import sqlite3
# Connect to the database
conn = sqlite3.connect('docs/database/recipes.db')
cursor = conn.cursor()
# Query all recipes
cursor.execute("SELECT title, language, category, prep_time, cook_time FROM recipes")
recipes = cursor.fetchall()
# Print recipes
for recipe in recipes:
print(f"Recipe: {recipe[0]} ({recipe[1]})")
print(f"Category: {recipe[2]}")
print(f"Prep time: {recipe[3]}, Cook time: {recipe[4]}")
print("---")
# Close the connection
conn.close()
This database is automatically regenerated each time the documentation is built, ensuring it always stays in sync with the markdown recipe files.
Recipe Categories
The following categories are used to classify recipes: - Breakfast - Starter - Main - Dessert - Sides