Code Monkey home page Code Monkey logo

healthdata_influx's Introduction

healthdata_influx

Imports Apple Health Data into InfluxDB.

Grafana Screenshot Visualizing InfluxDB using Grafana.

How to export iOS Health Data

  1. Go to the Health App
  2. Tap the profile image at the top right
  3. Tap "Export Health Data"
  4. Save the export.zip file and extract its XML contents (export.xml) somewhere accessible by this script.

Running as a complete service with Docker Compose (bonus Grafana Graphs!)

This is the easiest way to get up and running quickly. This will spin up the importer, an InfluxDB database, and Grafana with a default dashboard ready to go.

Requirements:

Installation:

  • Create a data directory at the project root and add the export.xml inside it

Building:

docker-compose build

Running:

  1. docker-compose up (add -d to run in daemon mode)
  2. Access Grafana in your web browser: http://localhost:3000

Username: admin Password: admin

Refreshing data:

  1. Replace data/export.yml with a new version
  2. docker-compose run importer

Running as a Python module or stand-alone script.

Requirements:

Installation:

  • pip install -r requirements.txt
  • Rename config_sample.yml to config.yml

Configuration:

  • Edit config.yml to match your InfluxDB settings (host, auth, etc.)

Usage:

  1. Export Health Data from iOS device
  2. python3 import.py export.xml

See also:

python import.py --help

Running as a stand-alone Docker container

Requirements:

Installation:

  • Create a data directory at the repo root and add the export.xml inside it.
    • (note that this can be anywhere if the volume mount point on the docker run command is changed)

Configuration:

  • Edit config.yml to match your InfluxDB settings (host, auth, etc.)

Building:

docker build . -t twstokes/healthdata_influx

Running (at the repo root):

docker run -v $PWD/data:/data:ro -v $PWD/config.yml:/app/config.yml:ro twstokes/healthdata_influx

Todo / Notes:

  • Does not support "Mindful Sessions"

healthdata_influx's People

Contributors

twstokes avatar nickbusey avatar kolontsov avatar

Watchers

Leo Lorenzo Luis avatar  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.