Skip to main content

Sync Withings data to Intervals.icu

Project description

Withings2Intervals

A Python script to sync wellness data from Withings to Intervals.icu.

This script is a fork of this Gist and has been enhanced with features such as:

  • Configurable start dates for syncing.
  • Prevention of duplicate syncing using a log file.
  • Added debugging support via a -v flag.
  • Refactored for better maintainability and extensibility.

Features

  • Fetches data from Withings using their API.
  • Uploads wellness data (weight, body fat %, muscle mass %, blood pressure, etc.) to Intervals.icu.
  • Tracks synced days to avoid duplicate uploads.
  • Supports a --force-resync option to re-upload data.
  • Debugging support with -v.

Installation from pip

You can simply install the package from PyPi

pip install withings2intervals

Installation from repository

  1. Clone the Repository:

    git clone https://github.com/your-username/withings_syncer.git
    cd withings_syncer
    
  2. Install Dependencies with Poetry: Make sure you have Poetry installed.

    poetry install
    
  3. Build

    poetry build
    
  4. Install

    pip install dist/withings2intervals-<version>.whl
    

Setup

1. Create a Withings Developer App

  1. Go to the Withings Developer Portal.
  2. Sign in and create a new app:
    • App Name: Choose a name (e.g., "Withings Syncer").
    • Callback URL: Use http://localhost:80.
    • Save the app and copy the Client ID and Client Secret to the config.ini

2. Get your intervals.icu keys

  1. Go to the Intervals.icu settings page
  2. Scroll until you see Developer Settings
  3. Click on "API Key (view)"
  4. Click on "Generate"
  5. Copy the generated API key to the config.ini
  6. Copy also the "Athlete ID" to config.ini

3. Run initial authentication

  1. Run python withings2intervals.py
  2. Follow on screen instructions

Once the initial authentication is successfully completed your OAuth2 token will be saved locally and you will be able to run subsequent synchronizations.

Usage

Run the script with the following options:

  • Sync Today's Data:

    withings2intervals
    
  • Sync Data from a Specific Date:

    withings2intervals --start 2024-12-01
    
  • Force Resync:

    withings2intervals --start 2024-12-01 --force-resync
    
  • Verbose Debugging:

    withings2intervals -v
    

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

withings2intervals-0.1.4.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

withings2intervals-0.1.4-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file withings2intervals-0.1.4.tar.gz.

File metadata

  • Download URL: withings2intervals-0.1.4.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for withings2intervals-0.1.4.tar.gz
Algorithm Hash digest
SHA256 21f7b055a9404e5a989038bbec9e24e94a224818f9306901b69f94b16fced9f4
MD5 2a5ecb6f79546e9c7c4cd4461a1f2671
BLAKE2b-256 a995b2832aca74edba0de681de44405aff9a562a7bf286fac922a70cb11596fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for withings2intervals-0.1.4.tar.gz:

Publisher: python-publish.yml on stezz/withings_syncer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file withings2intervals-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for withings2intervals-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 037350a8d260b73e9a81ad46b33f74d84a809ab25d8dad0dd4780b654c6f1735
MD5 e02442da3b86a3fb86a2add960ddb256
BLAKE2b-256 cb4148cfb7615774ea54864b04d499c164629e892d42206c6ae43e21c9caf3bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for withings2intervals-0.1.4-py3-none-any.whl:

Publisher: python-publish.yml on stezz/withings_syncer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page