styx102 commited on
Commit
8dfcf3d
Β·
verified Β·
1 Parent(s): 7366c4c

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +16 -1
  2. progress_data.json +7 -0
  3. 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
- return "\n".join(plan)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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