health/
src/
health/
tests/
test_withings.py
pyproject.toml
README.md
uv.lock
Backend for all personal health data. Currently hosts the Withings Body Scale integration; additional health sources (activity, sleep, etc.) will live here too.
The Withings scale has no local API — it syncs to the Withings cloud over WiFi, and you read it back through the Withings OAuth2 REST API. The health CLI wraps that flow.
Note: the scale's USB port is charging-only (no data interface), and firmware updates happen automatically over WiFi via the Withings phone app. Neither can be done from a Mac.
uv sync --extra test
client_id and client_secret. Use a redirect URI such as
http://localhost:1110/ (it only needs to be registered, not served)..env):bash
export WITHINGS_CLIENT_ID='…'
export WITHINGS_CLIENT_SECRET='…'
code from the redirect):bash
health authorize
Tokens are cached in withings_tokens.json and refreshed automatically.
health measure --db withings.sqlite
health latest --db withings.sqlite
measure fetches weight, fat ratio, fat mass, muscle mass, hydration, and bone
mass (meastypes 1,6,8,76,77,88) and stores them in a small SQLite table
(measurements(grpid, date, attribute, value)). Use --meastypes to change the
set and --start/--end (Unix timestamps) to bound the history.
MIT