SmartShelf operates on a lightweight state model built around Pandas DataFrames. All pantry and shopping data originate from CSV storage.
CSV → load_csvs()
→ Pandas DataFrames (userPantry, shoppingList)
→ UI Interaction
→ Data Update
→ closeout() → Save CSV
userPantry.loc[
userPantry['item_name'] == original_name,
'quantity'
] = qty_val
This direct DataFrame mutation keeps state consistent across UI rendering cycles.