Leo-Health-Core: Unify Apple Health & Whoop Data Locally with SQLite

Summary
Leo-Health-Core is an open-source Python tool designed to parse Apple Health and Whoop exports, unifying your biometric data into a local SQLite database. It operates with zero dependencies and no network requests, ensuring complete privacy and local control over your health information. This project allows users to easily query and analyze their personal health trends using standard SQL.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
Leo-Health-Core is an open-source Python project that provides a powerful solution for managing your personal health data. It addresses the common challenge of fragmented biometric data, often locked in large Apple Health XML exports or inconsistent Whoop CSV files. Leo-Health-Core unifies this data into a single, normalized SQLite database, making it easily queryable with standard SQL. Designed with privacy at its core, it boasts zero dependencies and performs no network requests, ensuring all your sensitive health information remains securely on your local machine. This tool is ideal for developers and privacy-conscious individuals who want full control and analytical capabilities over their health metrics.
Installation
Getting started with Leo-Health-Core is straightforward, whether you prefer a direct installation or using Docker for cross-platform compatibility.
Direct Installation (macOS):
- Clone the repository:
git clone https://github.com/sandseb123/Leo-Health-Core.git - Navigate into the directory:
cd Leo-Health-Core - Install in editable mode:
pip3 install -e .Note: If
pip3is not found, trypip install -e .or install Python 3.9+ from python.org.
Docker Installation (macOS, Linux, Windows):
- Clone the repository:
git clone https://github.com/sandseb123/Leo-Health-Core.git - Navigate into the directory:
cd Leo-Health-Core - Start the dashboard:
docker compose up -d - Open in browser:
open http://localhost:5380Drop your health exports into the
imports/folder, and Leo will detect and ingest them automatically.
Examples
Once installed, Leo-Health-Core provides several commands to interact with your data and a web dashboard for visualization.
Terminal Commands:
leo: View your health dashboard directly in the terminal.leo-watch: Start watching your Downloads folder for new health exports, automatically parsing them.leo-dash: Open the full web dashboard in your browser.
Querying Your Data with SQL:
You can directly query your unified health data using SQLite.
First, open the database:
sqlite3 ~/.leo-health/leo.db
Then, run SQL queries like these:
-- Last 7 days of Whoop recovery
SELECT recorded_at, recovery_score, hrv_ms, resting_heart_rate
FROM whoop_recovery
ORDER BY recorded_at DESC LIMIT 7;
-- HRV by source (Apple Watch vs Whoop)
SELECT source, ROUND(AVG(value), 1) as avg_hrv, COUNT(*) as readings
FROM hrv GROUP BY source;
-- Sleep stage breakdown
SELECT stage, COUNT(*) as sessions
FROM sleep GROUP BY stage ORDER BY sessions DESC;
Why Use It
Leo-Health-Core stands out for several compelling reasons, especially for those prioritizing data ownership and privacy:
- Complete Data Privacy: All processing and storage happen locally on your machine. There are zero network requests, ensuring your sensitive health data never leaves your device.
- Unified Data Source: It consolidates disparate data from Apple Health and Whoop into a single, normalized SQLite database, simplifying analysis.
- Easy Querying: With your data in SQLite, you can use standard SQL queries to explore trends, compare metrics, and gain insights without relying on proprietary apps or cloud services.
- Automated Ingestion: The
leo-watchfeature automatically detects and parses new health exports dropped into your Downloads folder, streamlining the data import process. - Open Source and Extensible: Being open source and MIT licensed, Leo-Health-Core is free to use, modify, and extend, offering transparency and flexibility.
- Future AI Integration (Leo Max): The project has a roadmap for Leo Max, an upcoming local AI health coach that will analyze your data privately, cross-reference medical literature, and even ingest bloodwork PDFs, all without sending data off your machine.
Links
- GitHub Repository: https://github.com/sandseb123/Leo-Health-Core
- Leo Max Waitlist: https://sandseb123.github.io/Leo-Health-Core