/watchlib

Python module for analyzing and visualizing Apple Watch health data.

Primary LanguagePythonMIT LicenseMIT

watchlib

watchlib is a python library for analyzing and visualizing Apple Watch health data.

Features:

  • DataLoader
  • CacheHandler
  • ECGAnimation
  • WorkoutAnimation
  • ecg_analysis
  • ECG
  • WorkoutRoute

Get data from health export

To use this Python package you first have to export the health data:

  1. Open Health app
  2. Open your profile in the upper right corner
  3. Scroll down
  4. Tap on "Export all health data"
  5. Confirm that you want to export all health data
  6. Wait until the export has finished (this might take some minutes)
  7. Select "Save in files"
  8. Choose a folder and tap "Save"
  9. Last step is to unzip the "Export.zip" file

ECG

ECG Analysis

Calculate various heart rate metrics from a 30 second ECG:

  • beats per minute (bpm)
  • time between heartbeats in ms
  • heart rate variability (hrv)
  • coming soon: ECG wave detection

ECG Plotting and Animation

  • plot ECG
  • plot ECG together with metrics
  • animate ECG

Workout Route

Filtering workout routes by:

  • country
  • bounding box size in km
  • length of workout in min

3D animation of workout routes:

  • coloring based on:
    • elevation
    • speed
    • course
    • horizontal acceleration
    • vertical acceleration

Other Health Data

  • loading and converting other health data

Analysis of other health data

coming soon

Notebook demos

Streamlit demo

streamlit ecg streamlit workout

ECG heartbeat calculation

ECG heartbeat calculation slow ECG heartbeat calculation fast

Workout Animation

Watch an example workout animation here