Python Metabolism and Weight data

Overview

PyPi module N/A
git repository https://bitbucket.org/arrizza-public/metabolism-weight
git command git clone git@bitbucket.org:arrizza-public/metabolism-weight.git
Verification Report https://arrizza.com/web-ver/metabolism-weight-report.html
Version Info
  • Ubuntu 22.04 jammy, Python 3.10
  • Ubuntu 24.04 noble, Python 3.10

Summary

This project is to gather and aggregate data about activity and weight.

Get raw data

Withings Body+ scale

  • Login to Withings Login
  • click on Support in the menubar
  • enter "export data"
  • click on "Privacy - How can I export my data?"
  • click on the provided link "... all of your data at once by clicking this link"
  • click "Start my archive"
  • After a few minutes, you will get an email with a link
  • download the zip file into ~/Downloads
  • extract the data
  • copy these files to metabolism-weight/data
    • weight.csv

The weight.csv should have the following columns:

  • Date
  • Weight (lb)
  • Fat mass (lb)
  • Bone mass (lb)
  • Muscle mass (lb)
  • Hydration (lb)
  • Comments

Samsung Galaxy 4 Watch

  • on your phone, go to Samsung Health
  • go to settings
  • scroll to "Download personal data", click it
  • download the data to your phone
  • plug your phone to your PC via USB-C
  • On "allow access to phone data?" click Allow
  • The phone data should not be mounted on your PC
  • go to Internal Storage/Download/Samsung Health
  • there should be a "samsunghealth_smartthings_"
  • copy these files from folder to metabolism-weight/data (note: very slow!)
    • com.samsung.shealth.activity.day_summary.
    • com.samsung.shealth.calories_burned.details.

Run

./doit
./doit --verbose     # to see the daily data
./doit --year 2025   # only load data for the given year; defaults to 2024
./doit --year all    # load all data

Typical Output:

<snip>
 40 2024-10-06 Sun  62,059   4,661  221.4   75.6  138.5 
 41 2024-10-13 Sun  75,023   6,811  221.2   71.8  142.0 
 42 2024-10-20 Sun  77,305   5,733  221.0   71.7  141.9 
 43 2024-10-27 Sun  59,554   3,688  221.7   71.3  143.0 
 Total steps   :  3,038,807
 Total calories:    216,647

The columns are:

  • week number: from 1 to 53 (see isocalendar())
  • date: this is weekly summary so it will be on Sundays
  • steps: the number of steps for the week
  • calories: the number of calories reported by Samsung Galaxy for the week; It takes 13 - 15 steps per calorie.
  • weight: the value reported by the Withings Scale, in this case pounds
  • fat: the value reported by the Withings Scale, in this case pounds
  • muscle: the value reported by the Withings Scale, in this case pounds

This shows that in the last 4 weeks, I've lost 4 pounds of fat and added 4 pounds of muscle, which results in no weight gain or loss. In the 10 months from Jan 1 to end of October I've walked 3 million steps and burnt over 216,000 calories.

Note the weight, fat and muscle values are an average of values for the week.

Spreadsheet

A .xlsx spreadsheet is generated. There are three worksheets.

Weekly Summary worksheet

This shows the weekly summary on each Sunday of the year. The values are averages for the 7 days of the week.

Week Date           Steps   Cals    Fat     Weight  Muscle  Score
1   2024-01-07 Sun  55,289  3,403   68.8    224.6   148.0   E -++
2   2024-01-14 Sun  54,528  3,541   72.9    221.8   141.5   F -+-
3   2024-01-21 Sun  70,260  4,532   72.9    220.8   140.6   C ++-
[snip]
41  2024-10-13 Sun  75,023  6,811   71.8    221.2   142.0   A +++
42  2024-10-20 Sun  77,305  5,733   71.7    221.0   141.9   C ++-
43  2024-10-27 Sun  59,554  3,688   71.3    221.7   143.0   B +-+

The "Score" column indicates a rough A through H classification. A and B are pretty good weeks, the rest are not as good. The three "+/-" shows whether the Fat, Weight and Muscle changed in a good way i.e. Fat went down, weight stayed the same or went down and Muscle stayed the same or went up.

Daily Summary worksheet

This shows the daily summary for each day of the year. The values are averages for all measurements taken during the day.

Date           Week  Steps  Cal     Fat   Weight  Muscle
2024-01-01 Mon  1    2,760    130    0.0     0.0     0.0
2024-01-02 Tue  1   10,603    623    0.0     0.0     0.0
2024-01-03 Wed  1   16,172  1,160   70.4   224.7   146.6
[snip]

Stats worksheet

This shows various status over the course of the year.

          Year Total    Avg. Week   Avg. Daily    Min     Max
Steps      3,038,807     70,669.9     10,095.7   354.0  23,877.0
Calories     216,647      5,038.3        719.8    17.9   2,441.9
Weight           N/A          N/A        223.5   218.5     229.7
Fat              N/A          N/A         72.8    66.4      77.8
Muscle           N/A          N/A        143.2   134.7     150.0
  • Year Total: total of all measurements for the entire year
  • Avg. Week: the average of week measurements
  • Avg. Daily: the average per daily measurements
  • Min: the minimum measurement found
  • Max: the maximum measurement found

- John Arrizza