All Projects → omriasta → ifitsync

omriasta / ifitsync

Licence: GPL-3.0 license
Python script to sync iFIT data to your Google Fit Account

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ifitsync

google fit hass
A Home assistant custom component to get your fitness information using Google Fitness API.
Stars: ✭ 23 (-20.69%)
Mutual labels:  google-fit
rn-fitness-tracker
React Native module to interact with Google Fit and Apple HealthKit.
Stars: ✭ 58 (+100%)
Mutual labels:  google-fit
fitbit-googlefit
Export Fitbit data to Google Fit. Unlike the alternatives such as fitnessyncer.com, this offers very fine intraday granularity (every minute/second data).
Stars: ✭ 433 (+1393.1%)
Mutual labels:  google-fit
haconfigs
My Home-Assistant configuration files
Stars: ✭ 61 (+110.34%)
Mutual labels:  google-fit

ifitsync

ClientId and Secret are now gathered by the script using web scraping If you already used the script previously you will have to reinstall requirements.txt and delete ifit-credentials.json.

Currently iFit does not have any documentation on the API and there is no way to integrate an app using their website. I have an iFit treadmill so that is the only thing this is written for but if you look at the code you should be able to tweak it to work with other equipment or even other services beyond google fit. The project files are separated so you can use just "get_ifitaccount.py" to get the JSON responses from the API and then write some other code to upload to other services.

Windows users can use the exe file under dist, you will need to create the credentials.json file (listed below) and save it to the same directory as the exe. No need to worry about the virtual environment.

INSTRUCTIONS:

Go to https://console.developers.google.com

Create a new project and give it a name

Under Library search for fitness api and click on it, then enable the api

Then go to credentials and create new credentials, download the file and save it as credentials.json in the folder (This follows the instructions here: https://developers.google.com/docs/api/quickstart/python)

Create a virtual environment: python3 -m venv venv

Activate the Virtual environment: source venv/bin/activate

Install requirements: pip install -r requirements.txt

Run the script: python ifitsync.py

Enter ifit user and pass when prompted

A browser should open and prompt you to sign in to google and grant access to some Google Fit related options, allow them all

Close the browser when prompted and wait for the script to continue

You should see the results of uploaded datasets for each aspect of each workout.

After you go through this once, you will not be prompted for credentials again as the script will now use refresh tokens for both google and ifit.

Currently supports uploading the following:

  • Heart Rate which is sampled throughout the workout
  • Speed sampled throughout the workout
  • Power in watts sampled throughout the workout
  • Calories expended sampled throughout workout
  • Distance sampled throughout the workout
  • Step count sampled throughout workout
  • Workout name taken from iFit
  • Elevation Data in Meters (as a custom datatype)
  • Treadmill Incline Degrees (as a custom datatype)
  • Location/Elevation GPS data is now uploaded for iFit workouts that are based on a Google Maps Route

Some notes and suggestions regarding the script can be found on the Wiki: https://github.com/omriasta/ifitsync/wiki Below are screenshots of a workout from iFit and how it appears in Google Fit:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].