Convert HealthKit XML files to CSV
- Open the Health app on your iPhone
- Press upperhand right corner "Person" symbol
- Click on "Data export" at bottom (mileage may vary depending on language settings)
- You may share the resulting zip file by mail, iCloud or similar
python run.py Export.xml export.csv
- Import the resulting CSV file into your spreadsheet or data parsing application of choice!
-
How can I modify which values are parsed?
Just change the array at the beginning of run.py:
types = ["HKQuantityTypeIdentifierHeartRate"]
You may find additional field specifiers inside the XML file.
-
Excel isn't importing the CSV in the right format!
Your field and line separators may vary on your platform. Change the following variables accordingly:
field_separator = ";" line_separator = "\n"