Git Product home page Git Product logo

apple-watch's Introduction

apple-watch

Analyses using Apple Watch data

Prep data

Download the data from the Apple Health app on your iPhone. You can do this by going to the Health app, clicking on your profile picture in the top right corner, and selecting "Export All Health Data". This will create a zip file that you can share with yourself. Download the zip file and extract the contents. The important file in this extract is export.xml. I have this file saved in a folder data/apple_health_export in this repository. I have the data folder in the .gitignore file so that the data is not uploaded to this GitHub repository.

To convert the export.xml file to a CSV file, I found this great resource with sample code. I've copied their parsing function to convert_xml_to_csv.py in this repository.

To see the xml data as json within the terminal, run the following command in the Terminal:

python convert_xml_to_csv.py data/apple_health_export/export.xml

To convert the xml data to a csv file, run the following command in the Terminal:

python convert_xml_to_csv.py data/apple_health_export/export.xml | jq -r '[.startDate, .endDate, .type, .unit, .value] | @csv' > data/apple_health_export/export.csv

This requires the JSON parser jq to be installed. I installed jq via Homebrew on my Mac with: brew install jq.

apple-watch's People

Contributors

lindsayevanslee avatar

Watchers

 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.