Giter VIP home page Giter VIP logo

simple-apple-health-xml-to-csv's Introduction

Simple Apple Health XML to CSV

A simple script to convert Apple Health's export.xml file to an easy to use csv.

How to Run

1. Verify you have Python 3 & Pandas installed on your machine or environment

python --version should return Python 3.x.x where x is any number.

If you have Python 2.x.x, please upgrade to Python 3 here: https://www.python.org/downloads/ (or specify your environment's Python version)

python3 -c "import pandas" should return blank from the command line

If you get a ModuleNotFoundError: No module named 'pandas' error, install pandas and try again:

pip3 install pandas

2. Export your Apple Health Data

Health Home ➡️ Export Data

Your data will be prepared, and then you can transfer the export.zip file to your machine.

3. Unzip the file, which should contain:

  • apple_health_export
    • export.xml

    • export_cda.xml

4. Place the "apple_health_xml_convert.py" file from this repo into the folder alongside the files and run the script

python3 apple_health_xml_convert.py

The export will be written with the format:

  • apple_health_export_YYYY-MM-DD.csv

In Excel, the output should look something like this:

Note: This script removes the Apple Health data prefixes: HKQuantityTypeIdentifier, HKCategoryTypeIdentifier, and HKCharacteristicTypeIdentifier for increased legibility. Feel free to comment out those lines in the code with a # if you want to keep them in the CSV output.

simple-apple-health-xml-to-csv's People

Contributors

jameno avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.