A lightweight Python-based tool that takes in a recipe and calculates the calorie breakdown of each ingredient. Perfect for anyone looking to analyze the nutritional content of home-cooked meals.
├── App.py # Main script for calorie calculation
├── Food.ipynb # Jupyter notebook for interactive exploration
├── recipe.csv # Input recipe with ingredient names and amounts
├── recipe_calorie_breakdown.csv # Output file with calories per ingredient
└── .idea/ # IntelliJ/PyCharm project configuration
-
Input File (
recipe.csv) Contains a list of ingredients and their respective amounts in common kitchen units (e.g., cups, tsp). -
Calorie Lookup Logic (
App.py) Parses the recipe file, estimates calorie values using known approximations (e.g., 64 cal per tbsp of honey), and aggregates totals. -
Output File (
recipe_calorie_breakdown.csv) Includes calories per unit, total calories, and the adjusted calorie count per ingredient.
git clone https://github.com/NathanG1en/Food.git
cd FoodThis project only requires pretty standard Python libraries like pandas. You can install them via:
pip install streamlit
pip install pandas
pip install python-dotenvThis was one of my first projects, so I didn't use a package manager or make a requirements.txt, but these are only a couple dependencies
python App.pyThis will read recipe.csv, perform the calculations, and output recipe_calorie_breakdown.csv.
| Ingredient | Amount | Calories per Unit | Total Calories |
|---|---|---|---|
| White whole wheat flour | 2 cups (~240g) | ~110 cal per 30g | 816 |
| Honey | 1/3 cup (~113g) | ~64 cal per tbsp (~15g) | 343 |
| Coconut oil | 1/4 cup (~55g) | ~117 cal per tbsp (~15g) | 486 |
| ... | ... | ... | ... |
- Built using Python 3.x
- Optimized for use with PyCharm (project files under
.idea/) - Notebook (
Food.ipynb) included for experimentation or visualization
- Automate unit conversion (e.g., cups to grams)
- Integrate with the USDA FoodData Central API
- Add macro breakdown (fat, protein, carbs)
- Build a better UI (not w/ streamlit)
Designed for the food product development club at UF. Can be used by any one who is interested in figuring out the nutritional content of their recipes!
MIT License. See LICENSE for details.