healthkit-to-sqlite-cli-0.0.4 is not a library.
healthkit-to-sqlite
Command-line tool to convert Apple HealthKit data to a SQLite database.

Getting Started
- Open the Health app on your iOS device.
- Click your profile icon in the top-right corner.
- Click the "Export All Health Data" button.
- Share the resulting ZIP archive to your computer.
- Run the healthkit-to-sqlite tool on the exported ZIP archive.
Datasette
You can use https://datasette.io/ to view and explore the resulting SQLite database file. Install the https://datasette.io/plugins/datasette-geojson-map plugin to visualize the workout routes data on a map.
Decisions
- Only the
Record,Workout, andActivitySummaryelements are currently exported. Recordelements are inserted to a table with a name matching the value of the element'stypeattribute.Workoutelements are inserted to a table named "Workout".- The descendent
workoutEventandworkoutStatisticselements are represented as JSON columns. - The descendent
workoutRouteelement is converted to a GeoJSON LineString and stored in a JSON column named "geometry" for easy integration with https://datasette.io/plugins/datasette-geojson-map. - The JSON columns can be verbose and result in large HTML table cell sizes, making it difficult to browse the results. In this case, it may be useful to specify the truncate_cells_html setting
datasette healthkit.db --setting truncate_cells_html 40. Note that this setting does not appear to be compatible with the datasette-pretty-json plugin.
- The descendent
ActivitySummaryelements are inserted as rows to a table named "ActivitySummary".- In an attempt to future proof against Apple adding, removing, or changing element attributes, the code only assumes the existence of a limited number of attributes:
Recordelements must have atypeattribute.Workoutelements must have aworkoutActivityattribute.MetadataEntryelements must havekeyandvalueattributes.FileReferenceelements must have apathattribute.