fitsync

Synchronizes user data between several fitness services.

  • 所有者: tantalor/fitsync
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Fitsync is a python app that syncs data between Fitbit and Google Fit.

Currently, it only copies weight data from Fitbit to Google.

Setup

Environment

Use virtualenv to create an environment to install required packages,

$ virtualenv env

Activate the environment in your shell,

$ source env/bin/activate

Use pip to install the required packages,

$ pip install -r requirements.txt

Fitbit Credentials

Register a Fitbit application with:

  • OAuth 2.0 Application Type: Personal
  • Callback URL: http://localhost:8080/
  • Default Access Type: Read-Only
  • any values you want for application name, website, organization, and organization website
    Note the resulting OAuth 2.0 Client ID and Client Secret.

Run auth_fitbit.py to get credentials for read access to a user's data,

$ python auth_fitbit.py [FITBIT CLIENT ID] [FITBIT CLIENT SECRET] 

This scripts open a browser window where you can log in to your Fitbit account and authorize the app to "access your profile and data". When you accept, the script writes the credentials to a local file named fitbit.yaml.

Google Credentials

Create a project in Google Developers Console and enable the fitness API. Create an OAuth client ID with Other UI type and select User data. Note the client id and client secret.

Run auth_google.py to get credentials for write access to a user's body data,

$ python auth_google.py [GOOGLE CLIENT ID] [GOOGLE CLIENT SECRET] https://www.googleapis.com/auth/fitness.body.write

This script opens a browser window where you can log in to your Google account and authorize the app to "View and store body sensor data in Google Fit". When you accept, the script writes the credentials to a local file named google.json.

Usage

Use the patch command to download data from Fitbit and upload to Google,

$ python fitsync.py patch

Use the delete command to remove data from Google,

$ python fitsync.py delete

Use the get command to see the data stored in Google,

$ python fitsync.py get

There are a few options supported,

$ python fitsync.py --help

=======

Cron

The included cron.sh script can be used to keep your Fitbit and Google Fit data in sync automatically.
Simply add the following line to your crontab to run the job daily at 11:00.

00 11 * * * /path/to/fitsync/cron.sh

See your data

To view weight data on Google Fit,

  1. Choose "See graph details" for any day
  2. Choose "+ Add chart"
  3. Choose "Weight"
  4. Choose "Day", "Week", or "Month" to see the data for that time period

主要指標

概覽
名稱與所有者tantalor/fitsync
主編程語言Python
編程語言Python (語言數: 2)
平台
許可證
所有者活动
創建於2014-12-15 03:04:58
推送於2019-03-12 01:16:17
最后一次提交2016-05-31 11:02:19
發布數0
用户参与
星數70
關注者數13
派生數15
提交數41
已啟用問題?
問題數8
打開的問題數5
拉請求數7
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?