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
-vflag. - 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-resyncoption 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
-
Clone the Repository:
git clone https://github.com/your-username/withings_syncer.git cd withings_syncer
-
Install Dependencies with Poetry: Make sure you have Poetry installed.
poetry install -
Build
poetry build -
Install
pip install dist/withings2intervals-<version>.whl
Setup
1. Create a Withings Developer App
- Go to the Withings Developer Portal.
- 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
- Go to the Intervals.icu settings page
- Scroll until you see Developer Settings
- Click on "API Key (view)"
- Click on "Generate"
- Copy the generated API key to the
config.ini - Copy also the "Athlete ID" to
config.ini
3. Run initial authentication
- Run
python withings2intervals.py - 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
Metadata
Release files for withings2intervals 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| withings2intervals-0.1.4.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| withings2intervals-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / withings2intervals-0.1.4.tar.gz
| Download URL | withings2intervals-0.1.4.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21f7b055a9404e5a989038bbec9e24e94a224818f9306901b69f94b16fced9f4
|
|
BLAKE2b-256 checksum How to use checksums |
a995b2832aca74edba0de681de44405aff9a562a7bf286fac922a70cb11596fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 24, 2024.
Transparency logRelease files / withings2intervals-0.1.4-py3-none-any.whl
| Download URL | withings2intervals-0.1.4-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
037350a8d260b73e9a81ad46b33f74d84a809ab25d8dad0dd4780b654c6f1735
|
|
BLAKE2b-256 checksum How to use checksums |
cb4148cfb7615774ea54864b04d499c164629e892d42206c6ae43e21c9caf3bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 24, 2024.
Transparency log