Read Apple Health app exports (HealthKit export.zip / export.xml) as typed DuckDB tables — records, workouts, routes, correlations, metadata, ECG, and more.
Compatibility Matrix
This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 |
|---|---|---|---|---|---|
| Linux AMD64 | |||||
| Linux ARM64 | |||||
| macOS AMD64 | |||||
| macOS ARM64 | |||||
| Windows AMD64 | |||||
| Windows ARM64 | |||||
| WebAssembly |
Installing and Loading
INSTALL healthkit_export FROM community;
LOAD healthkit_export;
Example
-- After INSTALL healthkit_export FROM community; LOAD healthkit_export;
-- Use a Health app export.zip (or test fixture path when developing from source)
SELECT function_name, parameters
FROM healthkit_export_functions()
ORDER BY 1
LIMIT 8;
SELECT type_short, count(*) AS n
FROM read_healthkit_export('export.zip')
GROUP BY 1
ORDER BY n DESC
LIMIT 10;
About healthkit_export
healthkit_export is a DuckDB scanner for exports produced by the
Apple Health app (HealthKit export.zip /
export.xml). Written in C on DuckDB's stable C API
(extension-template-c).
Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple, Apple Health, and HealthKit are trademarks of Apple Inc.
Discoverability
Prefer the extension catalogue over duckdb_functions() (stable C API cannot set
function descriptions or name positional parameters):
SELECT function_name, parameters, description, example
FROM healthkit_export_functions()
ORDER BY 1;
Table functions (v0.4.0)
-
read_healthkit_export(path [, types/start/end])— top-level Health records; optional named filters -
healthkit_workouts(path)— workout summaries -
healthkit_workout_events(path)/healthkit_workout_statistics(path)— workout children -
healthkit_activity_summaries(path)— daily activity rings -
healthkit_workout_routes(path)/healthkit_workout_route_points(path)— routes + GPX points -
healthkit_export_info(path)/healthkit_me(path)/healthkit_zip_inventory(path)— export catalogue -
healthkit_correlations(path)/healthkit_correlation_members(path)/healthkit_metadata(path) -
healthkit_heartbeat_points(path)— HRV instantaneous BPM points -
healthkit_ecg_recordings(path)/healthkit_ecg_samples(path)— ECG CSV sidecars (Name / DOB omitted) -
healthkit_export_functions()— zero-arg catalogue of the above
path may be export.zip, a directory containing export.xml, or export.xml itself.
Privacy
-
healthkit_mereturns characteristics (date of birth, sex, blood type, …) — treat as sensitive. - ECG parsers never return CSV Name or Date of Birth header fields.
Design notes
Large exports are a full scan (first pass can be memory-heavy). Prefer materialising
slices with COPY … TO '….parquet' for day-to-day analytics.
Top-level <Record> only in read_healthkit_export — nested Correlation children are
available via the dedicated correlation table functions (and usually also appear top-level).
Platform
Community builds target DuckDB 2.0.0 on macOS arm64, Linux, and Windows. Wasm and osx_amd64 are excluded.
Source
https://github.com/Mjboothaus/duckdb-healthkit-export — tag v0.4.0. Optional Python helpers in-repo are not part of this extension binary.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| healthkit_activity_summaries | table | NULL | NULL | |
| healthkit_correlation_members | table | NULL | NULL | |
| healthkit_correlations | table | NULL | NULL | |
| healthkit_ecg_recordings | table | NULL | NULL | |
| healthkit_ecg_samples | table | NULL | NULL | |
| healthkit_export_functions | table | NULL | NULL | |
| healthkit_export_info | table | NULL | NULL | |
| healthkit_heartbeat_points | table | NULL | NULL | |
| healthkit_me | table | NULL | NULL | |
| healthkit_metadata | table | NULL | NULL | |
| healthkit_workout_events | table | NULL | NULL | |
| healthkit_workout_route_points | table | NULL | NULL | |
| healthkit_workout_routes | table | NULL | NULL | |
| healthkit_workout_statistics | table | NULL | NULL | |
| healthkit_workouts | table | NULL | NULL | |
| healthkit_zip_inventory | table | NULL | NULL | |
| read_healthkit_export | table | NULL | NULL |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases | typed_value |
|---|---|---|---|---|---|
| temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |