You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Visualizing InfluxDB using [Grafana](https://grafana.com/).
6
6
7
-
### Requirements:
7
+
## How to export iOS Health Data
8
+
1. Go to the Health App
9
+
2. Tap the profile image at the top right
10
+
3. Tap "Export Health Data"
11
+
4. Save the `export.zip` file and extract its XML contents (`export.xml`) somewhere accessible by this script.
8
12
9
-
*[Python 3](https://www.python.org/)
10
-
*[InfluxDB](https://www.influxdata.com/)
13
+
## Running as a complete service with Docker Compose (bonus Grafana Graphs!)
11
14
12
-
### Installation:
15
+
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.
16
+
17
+
#### Requirements:
18
+
19
+
*[Docker](https://www.docker.com/) with [Docker Compose](https://docs.docker.com/compose/)
20
+
21
+
#### Installation:
22
+
23
+
* Create a `data` directory at the project root and add the `export.xml` inside it
24
+
25
+
#### Building:
26
+
27
+
`docker-compose build`
28
+
29
+
#### Running:
30
+
31
+
`docker-compose up` (add `-d` to run in daemon mode)
32
+
33
+
#### Refreshing data:
34
+
35
+
1. Replace `data/export.yml` with a new version
36
+
2.`docker-compose run importer`
37
+
38
+
## Running as a Python module or stand-alone script.
39
+
40
+
#### Requirements:
41
+
42
+
*[Python 3](https://www.python.org/)
43
+
* An accessible [InfluxDB](https://www.influxdata.com/) instance
44
+
45
+
#### Installation:
13
46
14
47
*`pip install -r requirements.txt`
15
48
* Rename `config_sample.yml` to `config.yml`
16
49
17
-
### Configuration:
50
+
####Configuration:
18
51
19
-
* Edit `config.yml`
52
+
* Edit `config.yml` to match your InfluxDB settings (host, auth, etc.)
20
53
21
-
### Usage:
54
+
####Usage:
22
55
23
56
1. Export Health Data from iOS device
24
57
2.`python3 import.py export.xml`
25
58
26
-
### Notes:
59
+
60
+
#### See also:
61
+
`python import.py --help`
62
+
63
+
## Running as a stand-alone Docker container
64
+
65
+
#### Requirements:
66
+
67
+
*[Docker](https://www.docker.com/)
68
+
69
+
#### Installation:
70
+
71
+
* Create a `data` directory at the repo root and add the `export.xml` inside it.
72
+
* (note that this can be anywhere if the volume mount point on the `docker run` command is changed)
73
+
74
+
#### Configuration:
75
+
76
+
* Edit `config.yml` to match your InfluxDB settings (host, auth, etc.)
77
+
78
+
#### Building:
79
+
80
+
`docker build . -t twstokes/healthdata_influx`
81
+
82
+
#### Running (at the repo root):
83
+
84
+
`docker run -v $PWD/data:/data:ro -v $PWD/config.yml:/app/config.yml:ro twstokes/healthdata_influx`
0 commit comments