Convert an Apple Health export into a local SQLite database and generate charts and advanced queries that the Health app does not expose.
- Python 3
- sqlite3
- Place your Apple Health
export.xmlin this folder. - Build the SQLite database:
python3 scripts/health_to_sqlite.py export.xml --out health.sqlite python3 scripts/health_postprocess.py --db health.sqlite
- Run queries:
sqlite3 health.sqlite < queries/dashboards.sql sqlite3 health.sqlite < queries/advanced_queries.sql
- Generate charts:
python3 -m venv .venv .venv/bin/python -m pip install matplotlib .venv/bin/python scripts/health_plots.py --db health.sqlite --out-dir plots .venv/bin/python scripts/health_social_plots.py --db health.sqlite --out-dir plots
workout-routes/(GPX files) for route importselectrocardiograms/(CSV files) for ECG imports
scripts/health_postprocess.pynormalizes source names and builds views.- Large files are excluded by
.gitignoreby default.
MIT