Mini Project Assignment: Daily Calorie Tracker CLI
| Detail | Value |
|---|---|
| Author | Ishan Rawat |
| Date | 5th October 2025 |
| Project Name | Caloric |
This project provides a simple, lightweight Command-Line Interface (CLI) application for tracking daily caloric intake. The primary goal is to offer a quick, digital method for manually logging meals and calculating key health metrics without the overhead of complex applications.
- Efficiency: Allow rapid data entry for meal and calorie data.
- Monitoring: Calculate the Total and Average daily calorie intake.
- Alerting: Provide an immediate warning if the average caloric intake exceeds a predefined safe limit (
Average_Safe_Calories).
The tool operates on direct user input to generate its report.
| Data Point | Type | Description |
|---|---|---|
| Meal Name | String |
The name of the food/meal (e.g., "Lunch Salad"). |
| Calories Intake | Float |
The caloric value of the meal. |
| Number of Meals (x) | Integer |
The initial count of meals to be logged. |
Output Data: The final report displays the total caloric sum, the average calories per meal, and a formatted breakdown table.
Data preparation focuses on collecting and organizing the user inputs for calculation:
- Collection: The program iteratively prompts the user for the name and calorie count for the specified number of meals.
- Storage: Meal names and calorie values are temporarily stored in two synchronized Python lists (
MealsandCalories). - Data Typing: Input values are immediately cast using
int()andfloat()to ensure they are ready for mathematical operations.
The "modeling" phase is based on standard arithmetic calculations and a simple rule-based comparison.
| Metric | Calculation |
|---|---|
| Total Calories (A) | Sum of all elements in the Calories list (sum(Calories)). |
| Average Calories | Total Calories divided by the number of meals (A / x). |
Rule-Based Alert Model:
- Threshold:
Average_Safe_Calories(Set to 600 in the current implementation). - Logic: If the calculated
Averageis greater than the threshold, a "Warning!!" is displayed.
Evaluation is performed by the user reviewing the generated report for accuracy:
- The program prints a detailed, formatted table (
Meal Breakdown) to the console, allowing the user to visually verify that all inputs were correctly captured. - The final output of the Total Calories and Average Calories acts as the summary metric, which the user can check against their dietary goals.
This CLI is ready for immediate use and requires a standard Python environment.
- Python 3.x installed on your system.
- Clone the repository or download the script:
git clone [https://github.com/rawatishan07/Tracker.py](https://github.com/rawatishan07/Tracker.py) cd Tracker.py - Run the script:
python Tracker.py
- Follow Prompts: The application will guide you through entering the number of meals and then the name and calorie count for each one.