This Python application merges nutrition, training, and wearable data to forecast weight‑change trends and validate whether a diet or bulk is actually on track.
Download health_bot.pyPain point: lifters and dieters track calories but rarely validate predictions against the scale. Spreadsheet workflows are manual, error‑prone, and skip workout expenditure.
Solution: a CLI tool that automatically ingests three CSV streams, models daily energy balance, graphs predicted vs actual weight, and flags when the deviation exceeds 3 %.
All three CSVs are normalised with Pandas
, merged on date, then passed to a calorie‑balance model that adds activity expenditure from workouts and steps.
# simplified excerpt
energy_in = crono_df['calories']
energy_out = 0.9 * hevy_df['kcal_est'] + 0.04 * steps_df['steps']
def predict_weight(start_wt, kcal_deficit):
return start_wt + kcal_deficit / 7700 # kcal per kg fat
daily_deficit = energy_in - energy_out - tdee
weight_pred = predict_weight(start_weight, daily_deficit.cumsum())
Full annotated code lives in health_bot.py.
The script exports a PNG plotted with Matplotlib
. Blue line = scale weight, dotted line = model prediction; grey band = ±3 % tolerance.
America/Chicago
via pytz
.