Pantry Data Flow & State Management

SmartShelf operates on a lightweight state model built around Pandas DataFrames. All pantry and shopping data originate from CSV storage.

Data Flow Overview

CSV → load_csvs()
    → Pandas DataFrames (userPantry, shoppingList)
    → UI Interaction
    → Data Update
    → closeout() → Save CSV

State Handling Strategy

Example: Updating Quantity


userPantry.loc[
    userPantry['item_name'] == original_name,
    'quantity'
] = qty_val

This direct DataFrame mutation keeps state consistent across UI rendering cycles.

Design Characteristics

← Back to Index