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, 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. Enter poetry virtual env

    poetry shell
    

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:

    python withings2intervals.py
    
  • Sync Data from a Specific Date:

    python withings2intervals.py --start 2024-12-01
    
  • Force Resync:

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

    python withings2intervals.py -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.1.tar.gz (5.0 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.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: withings2intervals-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 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.1.tar.gz
Algorithm Hash digest
SHA256 41be11188d211ad97b9c9ceaed79c0d173d57e91e39525859b8eea6fd2dc49d0
MD5 9368e802f5fe0347eef01b420608fe02
BLAKE2b-256 2b90909a4f7bed151f563ef9e4560db72b3f341c299cbd60d5e1d718b030f886

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for withings2intervals-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0b2d0714ab1ea63eb6377362e9871ff33caace77462bafca15f7a1d7da6e0a5
MD5 092916f3b8fddb4cedd9e39030a90db6
BLAKE2b-256 a93c7bccb2b26e1af2cb934be2fc7188497f9b8dfb992773777c0e9bfbb727b2

See more details on using hashes here.

Provenance

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