Ditch the Cloud: Parse Your Apple Health and Whoop Data into SQLite
Ever feel like your health data is just… out there? Apple Health and Whoop collect a ton of personal metrics, but they live in their own silos, often behind export files that are a pain to work with. What if you could just pull all that data down to your local machine and query it like any other dataset?
That’s exactly what Leo Health Core does. It’s a straightforward Python tool that takes those clunky XML and JSON export files from Apple Health and Whoop and transforms them into a clean, local SQLite database. Suddenly, your sleep, heart rate, workouts, and more are just a SQL query away.
What It Does
In simple terms, Leo Health Core is a data pipeline for your personal health metrics. You give it the export.xml file from Apple Health or the whoop_data.json from a Whoop export. It then parses the data, normalizes the schemas, and loads everything into a single SQLite database file on your computer. The database has separate, well-structured tables for different data types, making it easy to analyze your health trends without any external services.
Why It’s Cool
The beauty of this project is in its simplicity and empowerment. It’s not another cloud service or subscription. It’s a local-first tool that gives you direct ownership and control over your data. For developers, this opens up a playground of possibilities:
- Personal Data Analysis: Use Python (Pandas, Matplotlib) or even simple SQL to chart your sleep performance against your workout intensity over time.
- Build Personal Dashboards: Create a local Streamlit or Flask app to visualize your health metrics exactly how you want.
- Correlate Data: Combine your health data with other personal datasets, like your own productivity logs or calendar, to find hidden insights.
- It’s a Great Code Reference: The implementation is clean and shows how to handle complex XML parsing and JSON normalization into a relational schema—useful knowledge for many other data ingestion projects.
How to Try It
Getting started is pretty standard for a Python project. First, you'll need to export your data from Apple Health or Whoop (instructions for this are in the repo's README). Then, it's a matter of cloning and running the tool.
# Clone the repository
git clone https://github.com/sandseb123/Leo-Health-Core.git
cd Leo-Health-Core
# Install the dependencies (a virtual environment is recommended)
pip install -r requirements.txt
# Run the parser on your export file
python -m leo_health_core.apple_health --export-path /path/to/your/export.xml
# or for Whoop
python -m leo_health_core.whoop --export-path /path/to/your/whoop_data.json
The script will create a health_data.db SQLite file in your current directory. You can open it with any SQLite browser or connect to it from your favorite data analysis script.
Final Thoughts
As developers, we love having direct access to our data. Leo Health Core removes the middleman for two major health platforms, turning opaque exports into a queryable format. It’s a practical tool for the data-curious and a solid example of a clean data ingestion script. Whether you're looking to do some personal science, build a custom health tracker, or just want to own your data, this project is a fantastic starting point.
Check out the repo, give it a star if you find it useful, and maybe you'll discover something interesting about your own health patterns.
Follow us for more interesting projects: @githubprojects
Repository: https://github.com/sandseb123/Leo-Health-Core