项目作者: TomPlum

项目描述 :
:running: Spring Boot Koltin API for my activity trends data-visualisation dashboard.
高级语言: Kotlin
项目地址: git://github.com/TomPlum/activity-trends-api.git
创建时间: 2020-09-12T10:52:41Z
项目社区:https://github.com/TomPlum/activity-trends-api

开源协议:

下载


:running: Activity Trends API

About

See the ReactJS front-end here

Apple Health Data

The native iOS Health App produces an XML file containing all the data recorded from relevant devices (Phone, Watch etc.).
My export was ~1GB and ~3million lines, making it slow to de-serialise.

Record

Various <Record></Record> elements store data such as your height, body mass, heart rate etc.

  1. <Record
  2. type="HKQuantityTypeIdentifierHeight"
  3. sourceName="Tom’s iPhone X"
  4. sourceVersion="11.1"
  5. unit="ft"
  6. creationDate="2017-10-03 21:35:31 +0100"
  7. startDate="2017-10-03 21:35:31 +0100"
  8. endDate="2017-10-03 21:35:31 +0100"
  9. value="5.67585"
  10. ></Record>
  11. <Record
  12. type="HKQuantityTypeIdentifierBodyMass"
  13. sourceName="MyFitnessPal"
  14. sourceVersion="29814"
  15. unit="kg"
  16. creationDate="2020-05-15 15:13:45 +0100"
  17. startDate="2020-05-15 15:13:00 +0100"
  18. endDate="2020-05-15 15:13:00 +0100"
  19. value="80.1498"
  20. ></Record>
  21. <Record
  22. type="HKQuantityTypeIdentifierHeartRate"
  23. sourceName="Tom’s Apple Watch"
  24. sourceVersion="4.0"
  25. device="<<HKDevice: 0x280d6bac0>, name:Apple Watch, manufacturer:Apple, model:Watch, hardware:Watch3,4, software:4.0>"
  26. unit="count/min"
  27. creationDate="2017-09-28 13:48:11 +0100"
  28. startDate="2017-09-28 13:23:19 +0100"
  29. endDate="2017-09-28 13:23:19 +0100"
  30. value="80"
  31. >
  32. <MetadataEntry key="HKMetadataKeyHeartRateMotionContext" value="0"/>
  33. </Record>

Workout

Workout records store most of their data in the <Workout></Workout> element as attributes, but there are optional
<MetadataEntry/> elements nested inside subject to the workoutActivityType attribute.

  1. <Workout
  2. workoutActivityType="HKWorkoutActivityTypeElliptical"
  3. duration="16.36445068319638"
  4. durationUnit="min"
  5. totalDistance="0"
  6. totalDistanceUnit="km"
  7. totalEnergyBurned="177.234"
  8. totalEnergyBurnedUnit="kcal"
  9. sourceName="Tom’s Apple Watch"
  10. sourceVersion="4.0"
  11. creationDate="2017-10-02 20:10:35 +0100"
  12. startDate="2017-10-02 19:54:13 +0100"
  13. endDate="2017-10-02 20:10:35 +0100"
  14. >
  15. <MetadataEntry key="HKTimeZone" value="Europe/London"/>
  16. <MetadataEntry key="HKWeatherTemperature" value="53 degF"/>
  17. <MetadataEntry key="HKWeatherHumidity" value="8300 %"/>
  18. </Workout>

Global Positioning Service Exchange Format (GPX)

Outdoor workouts record the route you took and stores the data in a
GPS Exchange Format .gpx file. An example file is shown below
with only the first 2 track parts included for brevity.

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <gpx version="1.1" creator="Apple Health Export" xmlns="http://www.topografix.com/GPX/1/1"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
  5. <metadata>
  6. <time>2020-08-23T17:40:02Z</time>
  7. </metadata>
  8. <trk>
  9. <name>Route 2020-07-29 3:13pm</name>
  10. <trkseg>
  11. <trkpt lon="-2.538323" lat="53.252917">
  12. <ele>21.476473</ele>
  13. <time>2020-07-29T13:51:19Z</time>
  14. <extensions>
  15. <speed>1.642115</speed>
  16. <course>-1.000000</course>
  17. <hAcc>3.723220</hAcc>
  18. <vAcc>2.774929</vAcc>
  19. </extensions>
  20. </trkpt>
  21. <trkpt lon="-2.538320" lat="53.252903">
  22. <ele>22.036276</ele>
  23. <time>2020-07-29T13:51:20Z</time>
  24. <extensions>
  25. <speed>1.641947</speed>
  26. <course>-1.000000</course>
  27. <hAcc>3.388743</hAcc>
  28. <vAcc>2.516615</vAcc>
  29. </extensions>
  30. </trkpt>
  31. ...
  32. </trkseg>
  33. </trk>
  34. </gpx>