-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,70 @@ | ||
# HeartSync | ||
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 | ||
|
||
<img src="example.gif" alt="HeartSync in Action" width="600"/> | ||
|
||
## 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: | ||
|
||
```bash | ||
git clone [email protected]:edeng23/HeartSync.git | ||
cd HeartSync | ||
``` | ||
|
||
2. Install the required Python packages: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
3. Set up Google Calendar API credentials: | ||
- Create a project on the [Google Cloud Console](https://console.cloud.google.com/). | ||
- 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: | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters