Skip to content

Integrate heart rate data from Apple Health with your Google Calendar events. Analyze and visualize the correlation between your daily activities and heart rate, and discover which events made your heart race

License

Notifications You must be signed in to change notification settings

edeng23/HeartSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HeartSync

HeartSync in Action

Overview

This project analyzes heart rate data from Apple Health XML exports and correlates it with events from your Google Calendar.

Installation

Prerequisites

  • Python 3.7 or higher
  • A Google Cloud project with access to the Google Calendar API
  • Apple Health XML data export

Setup

  1. Clone the repository:

    git clone [email protected]:edeng23/HeartSync.git
    cd HeartSync
  2. Install the required Python packages:

    pip install -r requirements.txt
  3. Set up Google Calendar API credentials:

    • Create a project on the Google Cloud Console.
    • Enable the Google Calendar API for your project.
    • Download the credentials.json file and save it in the project directory.
  4. Export Apple Watch data:

    • Export Health Data from the iPhone:
      1. Open the Health app on your iPhone.
      2. Tap on your profile picture in the top right corner to access your health profile.
      3. Scroll down and tap on Export All Health Data.
      4. A confirmation dialog will appear. Tap Export to confirm.
      5. The Health app will prepare your data, which might take a few minutes.
      6. Once the data is ready, you'll be given the option to save it to a location of your choice. Save the file (it will be named export.zip) to a convenient location.
    • Unzip the Exported Data:
      1. Locate the export.zip file on your computer and unzip it.
      2. Inside the unzipped folder, you'll find an XML file named export.xml. This file contains all your health data, including heart rate data.
    • Move the export.xml File:
      1. Copy the export.xml file to the directory where your script is located.

Usage

  1. Ensure you have your Apple Health XML export file and your credentials.json file in the project directory.

  2. Run the script with the following command:

    python heartsync.py <export_file_path> <google_credentials_path>
    • <export_file_path>: Path to your Apple Health XML export file.
    • <google_credentials_path>: Path to your Google API credentials.json file.

    Example:

    python heartsync.py export.xml credentials.json
  3. The script will authenticate with Google Calendar, retrieve events, and correlate them with the heart rate data. The results will be displayed in your terminal.

About

Integrate heart rate data from Apple Health with your Google Calendar events. Analyze and visualize the correlation between your daily activities and heart rate, and discover which events made your heart race

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages