Skip to main content

FitBridge

PyPI Downloads GitHub
NOTE from Google: The Google Fit APIs, including the Google Fit REST API, will no longer be available after June 30, 2025. As of May 1, 2024, developers cannot sign up to use these APIs.
A simple script to sync Gadgetbridge exported data to Google Fit. Currently, only the Mi Band data is supported.

Install and Usage

This project is not recommended for normal users because it's not user friendly at all. I strongly suggest to only use this script if you know what you're doing.

You can install and run this script in Termux.

  1. Go to the Google API Console.
  2. Select a project, or create a new one.
  3. Click Continue to enable the Fitness API.
  4. Click Go to credentials.
  5. Click New credentials, then select OAuth Client ID (You may need to create a "OAuth consent screen" first, make sure you add your Google Fit account's Gmail address in "Test users" when creating a "OAuth consent screen").
  6. Under Application type, select "Desktop app".
  7. When the OAuth client is created, Click on "DOWNLOAD JSON".
  8. Install FitBridge:
pip install FitBridge
  1. Run the script for the initial setup:
$ FitBridge 

It seems that you are running this script for the first time (or the config directory is lost), Do you want to create a new config? (y/n): y

Enter the path to the client_secret.json file: PATH_TO_CLIENT_SECRET

Enter the path to the Exported GadgetBridge database file: PATH_TO_GB_DB

Adding DataSources to the API automatically? (If not, you have to create them manually and add data_source_ids to the config) (y/n): y
steps DataSource registered successfully: XXX
heart_rate DataSource registered successfully: XXX

Done!
  1. After the initial setup is done, You can sync the new data from the Gadgetbridge exported database by simply running the script again (Only the unsynced data will be synced):
$ FitBridge
Steps: Read 10 Rows
Steps: dataset inserted successfully.
Steps: latest inserted timestamp is 2023-06-04 18:34:20 (UTC)
Heart Rate: Read 96 Rows
Heart Rate: dataset inserted successfully.
Heart Rate: latest inserted timestamp is 2023-06-04 18:34:20 (UTC)

Metadata

Release files for FitBridge 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FitBridge 0.4
File Size Uploaded
fitbridge-0.4.tar.gz 19.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for FitBridge 0.4
File Interpreter ABI Platform
FitBridge-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 37.3 kB

Release files / fitbridge-0.4.tar.gz

Download URL fitbridge-0.4.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e067dd3c9cbdcecfd0ced3fccab623346dd6279a02ec1545debe40929802a1e4
BLAKE2b-256 checksum
How to use checksums
530221b2243422a9cb9510eccede91f4c5f5ea98b7c79b98237b94f82b2b5762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release files / FitBridge-0.4-py3-none-any.whl

Download URL FitBridge-0.4-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d058fdb9a29b68fcdeb70309e81b385a26e785f2d9238a27cebb20762004052
BLAKE2b-256 checksum
How to use checksums
766e95023c7ed1c88e2a38812bfb93e9dc00a1d1d47d2b3018b32ebb4b62caf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page