Wellness Tracker
This script helps you log and track various daily wellness metrics, offering a flexible approach where you choose what to monitor. It stores data locally in year-specific JSON files, performs basic data validation, and generates reports in the terminal or as HTML. The main goal is straightforward logging and simple summaries for easy month-to-month trend review, emphasizing consistency.

Note: Terminal color scheme is user-dependent.
Demo report
Demo report can show an example of tracking details (periodically regenerated). For most entries, author used Daily Wellness Data Tracker PWA for data entry.
Download
- Latest Release (SNAPSHOT): wellness-tracker.tar.xz - includes
wellness_tracker.py
anddwdt.html
---
Getting Started
- Download the
wellness-tracker.tar.xz
from the Download section and extract it. - Ensure you have Python 3 installed (tested on Python 3.13, likely compatible with earlier Python 3 versions).
- Open your terminal or command prompt.
- Navigate to the directory where you extracted the script.
- To log data:
python3 wellness_tracker.py
- To print a console report (for the current year):
python3 wellness_tracker.py -p
- To generate an HTML report (for the current year):
python3 wellness_tracker.py --html your_report_name.html
- Use the
-y YEAR
argument to specify a different year for reports or data entry context.
Core Functionality
- Data Entry: When run without arguments, prompts for daily data for metrics enabled in
ENABLED_METRICS
. Includes basic input validation. - Data Storage: Saves entries chronologically by date (
YYYY-MM-DD
) in yearly JSON files (e.g.,wellness_tracker_data_YYYY.json
). - Data Validation: On load, checks for valid date keys and ensures each day's entry is a dictionary.
Key Configuration Options
ENABLED_METRICS
: Python list defining which wellness metrics (e.g., 'weight', 'sleep') to track and report. This allows you to tailor the script to your specific needs - track one metric, or all of them.- Reference Goals (
..._REF
): Constants likeSTEP_GOAL_REF
andSLEEP_GOAL_REF
used as baselines for the scaled contribution of daily steps and sleep to thedaily_score
. - Daily Score Component Caps (
DAILY_..._CAP
): Constants likeDAILY_STEPS_SCORE_COMPONENT_CAP
andDAILY_SLEEP_SCORE_COMPONENT_CAP
that limit the maximum points daily steps or sleep can contribute to a single day's score, ensuring a balance among different metrics. WEIGHT_UNIT
: Set to 'kg' or 'lbs' for weight tracking.REFERENCE_PLAN_AND_PROGRAM_URL
: Optional URL for a link in the HTML report's footer.
Reporting Features
Generates reports for a specified year (defaults to current).
- Console Report (
-p
or--print
): Displays a yearly summary including raw total occurrences for enabled metrics, followed by a monthly breakdown. Each monthly metric includes a count of days it was logged. Highlights "best" and "worst" months based onmonthly_score
. - HTML Report (
--html FILENAME
): Exports a monthly summary table to an HTML file. Each monthly metric in the table includes a count of days it was logged (or sessions for cardio, styled similarly). Also highlights best/worst months. The summary table is horizontally scrollable. - Specify Year (
-y YEAR
or--year YEAR
): Both console and HTML reports can target a specific year with existing data.
Key Calculations & Data Display
Reports present direct, understandable monthly figures for each enabled metric, such as:
- Weight: Monthly average AM, PM, and overall daily weight, plus percentage change from the previous month with data, and the count of days weight was logged (this DML counts any day weight data was entered).
- Sleep: Monthly average hours of sleep per night, and the count of days sleep was logged (this DML counts any day sleep data, including 0 hours, was entered).
- Diet & Fluids Adherence: Total count of adherent days for the month. The
(Xd)
DML count for these metrics now reflects days of actual adherence (logged as 'yes' or '1'), due to the script's data normalization where a logged '0' (not adherent) is treated like a skipped entry for DML purposes. - Fasting: Total number of fasting days for the month. On these days, diet and fluid adherence are not counted or scored. The (Xd) DML count reflects days logged as fasting.
- Practice Sets: Total number of all types of completed practice sets (e.g., micro, super, GtG, skill work, exercise) for the month (sum of sets from days with >0 sets). The
(Xd)
DML count reflects days practice sets were positively logged (i.e., days with >0 sets). - HIT: Total number of completed HIT sessions for the month. The
(Xd)
DML count reflects days HIT sessions were logged as done. - Cardio: Total cardiovascular exercise duration for the month and the total count of cardio sessions
(Xs)
(days with >0 minutes of cardio). - Steps: Total number of steps for the month (sum of steps from days with >0 steps). The
(Xd)
DML count reflects days steps were positively logged (i.e., days with >0 steps).
Aggregation of activity metrics (like 'practice_sets', 'hit', 'cardio') is not dependent on the day of the week.
The monthly_score provides a heuristic for comparing month-to-month trends by reflecting your average daily engagement and consistency across chosen wellness metrics. Its calculation is as follows:
Daily Score Calculation
For each day that data is logged:
- A daily_score is computed by summing points from achieved metrics for that day.
- Binary/Completion Metrics: Most completion-based activities—like diet/fluid adherence (on non-fasting days), completing a HIT session, or doing any practice sets (>0) contribute a fixed point value (
COMPLETION_METRIC_SCORE
) to thedaily_score
. - A fasting day is also a completion metric but is treated specially: it contributes a higher, dedicated point value (
FASTING_DAY_SCORE
) and overrides any scoring for diet and fluid adherence for that day. - Scaled Metrics (Sleep & Steps): Daily sleep hours and step counts (from original logged data) contribute to the dailyscore based on their performance relative to your SLEEPGOALREF and STEPGOALREF. For example, (dailysteps / STEPGOALREF) forms the step component for the day. These daily components can be capped (e.g., at DAILYSLEEPSCORECOMPONENTCAP and DAILYSTEPSSCORECOMPONENTCAP points respectively, configurable at the top of the script) to ensure balance among different metrics. Importantly, if a reference goal (e.g., STEPGOALREF) is set to 0, that metric will contribute 0 points to the daily score for that day, effectively treating it as not scored.
Monthly Score Aggregation
- The final monthlyscore for a given month is the average of all calculated dailyscore values from the days data was logged within that month.
- If no data is logged for any day in the month, the monthly_score will be None (and typically displayed as N/A in reports).
This scoring approach means that:
- Days where multiple wellness goals are met will achieve a higher daily_score.
- Consistent daily effort across various metrics contributes to a higher average monthly_score.
- The score is intended for personal trend analysis and motivation, not as an absolute grade.
Design Philosophy & Compatibility
This script intentionally relies only on Python's standard library modules. This reflects the author's preference to minimize external dependencies, ensuring wider compatibility, easier setup, and simpler maintenance across diverse systems.
While this tool has seen several iterations, the current version is designed to be a generalized and multipurpose wellness logger.
It has been tested on Python 3.13 as of May 2025 and is expected to work on many earlier Python 3 versions due to its use of core functionalities.
This script aims for straightforward personal wellness data logging and trend review through simple summaries, championing consistency as a key to progress.