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.3.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.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: withings2intervals-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 e5ce1b66b94c33fba24c24eae12d103c141b3f941fc0dce24ca59774045a2186
MD5 143a7ce1f490ebb8f94070077fe54cd6
BLAKE2b-256 de965baccf7e5111c13bfd55b8e083328f1e6fd35da359d0618d8e9555f57369

See more details on using hashes here.

Provenance

The following attestation bundles were made for withings2intervals-0.1.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for withings2intervals-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4ec1eb1829c74315cee6ae53174a854df1853ab1748e9db5b18332896571a3b5
MD5 6a7e087217e494b4d89e6b6bef609975
BLAKE2b-256 d97d67cba7effe52e8df89551406dc82c731b8ba73d4fe41fc63f8548603b98e

See more details on using hashes here.

Provenance

The following attestation bundles were made for withings2intervals-0.1.3-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