πŸ•πŸ”₯ Pizza is great! πŸ”₯πŸ•

πŸ…Basic Concepts

πŸ… Understanding the core concepts of TomatoPy will help you make the most of the library. This guide introduces the fundamental ideas and components. πŸ₯«

πŸ• πŸ•

Core Components

1. Ingredients

Ingredients are the building blocks of TomatoPy. Each ingredient has properties that affect how it behaves during cooking operations.

from tomatopy import Ingredient

# Create a basic ingredient
tomato = Ingredient(
    name="tomato",
    amount=1,
    unit="whole",
    properties={
        "ripeness": 0.8,
        "water_content": 0.95,
        "sugar_content": 0.03
    }
)

2. Kitchen

The Kitchen class represents your virtual cooking environment. It manages cooking operations and maintains environmental conditions.

3. Recipes

Recipes combine multiple ingredients and define how they should be prepared.

Key Concepts

1. Property System

Ingredients have properties that affect their behavior:

  • Physical Properties: weight, volume, density

  • Chemical Properties: pH, water content, sugar content

  • Culinary Properties: ripeness, freshness, texture

2. Cooking Operations

Cooking operations transform ingredients through various methods:

  • Heat Application: simmering, boiling, roasting

  • Mechanical Action: chopping, blending, kneading

  • Chemical Changes: fermentation, curing

3. State Management

Ingredients maintain state throughout cooking operations:

Advanced Concepts

1. Flavor Profiles

Ingredients and cooked products have flavor profiles:

2. Unit Conversion

TomatoPy handles unit conversions automatically:

3. Error Handling

The library includes robust error handling:

Best Practices

  1. Always Use Virtual Environments

  2. Check Ingredient Properties Before Cooking

  3. Use Type Hints for Better Code

Next Steps

Last updated

Was this helpful?