Upload 3 files
Browse files- app.py +16 -1
- progress_data.json +7 -0
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -32,7 +32,22 @@ def generate_smart_plan(wake_time, swim_time, swim_duration, gym_today, sleep_ho
|
|
| 32 |
plan.append("πͺ No gym β light stretching and mobility recommended.")
|
| 33 |
plan.append("π½οΈ Eat protein + carbs within 30 minutes post-swim.")
|
| 34 |
plan.append("π Target 8β9 hours of sleep tonight.")
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# --------- Food Macro Estimator + GPT ---------
|
| 38 |
food_classes = ["pizza", "salad", "burger", "sushi", "spaghetti", "steak", "pancakes"]
|
|
|
|
| 32 |
plan.append("πͺ No gym β light stretching and mobility recommended.")
|
| 33 |
plan.append("π½οΈ Eat protein + carbs within 30 minutes post-swim.")
|
| 34 |
plan.append("π Target 8β9 hours of sleep tonight.")
|
| 35 |
+
\
|
| 36 |
+
timeline = []
|
| 37 |
+
timeline.append(f"β° {wake_time} - Wake Up + Hydrate")
|
| 38 |
+
try:
|
| 39 |
+
swim_hour, swim_min = map(int, swim_time.split(":"))
|
| 40 |
+
swim_end_hour = swim_hour + swim_duration // 60
|
| 41 |
+
swim_end_min = (swim_min + swim_duration % 60) % 60
|
| 42 |
+
timeline.append(f"π {swim_time} - Swim Practice ({swim_duration} min)")
|
| 43 |
+
timeline.append(f"π₯€ {swim_end_hour:02}:{swim_end_min:02} - Post-swim Nutrition")
|
| 44 |
+
except:
|
| 45 |
+
timeline.append("β Unable to parse swim time β add manually to your calendar.")
|
| 46 |
+
|
| 47 |
+
timeline.append("πͺ Gym: Today" if gym_today else "π§ Active Recovery: Mobility/Stretching")
|
| 48 |
+
timeline.append("π Bedtime: Aim for 8β9 hours of sleep")
|
| 49 |
+
|
| 50 |
+
return "\n".join(plan) + "\n\nπ Sample Timeline:\n" + "\n".join(timeline)
|
| 51 |
|
| 52 |
# --------- Food Macro Estimator + GPT ---------
|
| 53 |
food_classes = ["pizza", "salad", "burger", "sushi", "spaghetti", "steak", "pancakes"]
|
progress_data.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"50 Free PB": null,
|
| 3 |
+
"100 Fly PB": null,
|
| 4 |
+
"Training Streak": 0,
|
| 5 |
+
"Last Update": null,
|
| 6 |
+
"Gym PR": null
|
| 7 |
+
}
|
requirements.txt
CHANGED
|
@@ -5,4 +5,4 @@ opencv-python
|
|
| 5 |
mediapipe
|
| 6 |
pillow
|
| 7 |
numpy
|
| 8 |
-
openai
|
|
|
|
| 5 |
mediapipe
|
| 6 |
pillow
|
| 7 |
numpy
|
| 8 |
+
openai==0.28
|