Garmin SSO auth + Connect client
Project description
Garth
Garmin SSO auth + Connect Python client
Features
- OAuth1/OAuth2 authentication (OAuth1 token lasts ~1 year)
- MFA support with custom handlers
- Auto-refresh of OAuth2 token
- Auto-resume from
GARTH_HOMEorGARTH_TOKENenvironment variables - Works on Google Colab
- Pydantic dataclasses for validated data
- Full test coverage
Installation
pip install garth
Quick Start
Authenticate and save session
import garth
from getpass import getpass
garth.login(input("Email: "), getpass("Password: "))
garth.save("~/.garth")
Resume session
import garth
from garth.exc import GarthException
garth.resume("~/.garth")
try:
garth.client.username
except GarthException:
# Session is expired. You'll need to log in again
pass
Or use environment variables for automatic session restoration:
export GARTH_HOME=~/.garth
# or
export GARTH_TOKEN="eyJvYXV0aF90b2tlbi..." # from `uvx garth login`
import garth
# Session is automatically loaded
garth.client.username
Fetch data
# Get daily stress
garth.DailyStress.list("2023-07-23", 7)
# Get sleep data
garth.SleepData.get("2023-07-20")
# Get weight
garth.WeightData.list("2025-06-01", 30)
# Direct API calls
garth.connectapi("/usersummary-service/stats/stress/weekly/2023-07-05/52")
Documentation
Full documentation at garth.readthedocs.io
MCP Server
garth-mcp-server is in early development.
To generate your GARTH_TOKEN, use uvx garth login.
Star History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file garth-0.6.3.tar.gz.
File metadata
- Download URL: garth-0.6.3.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
519d4b532944638652bb740ee44dcf36e1d234321aecf085edd7f1a81ea66f69
|
|
| MD5 |
96e08482873afe7a0513cc0b88759a69
|
|
| BLAKE2b-256 |
20887b9cb1bd266acdab2b83444e6271ed1655d097713ef00b5f2c99ddb8f9c0
|
Provenance
The following attestation bundles were made for garth-0.6.3.tar.gz:
Publisher:
publish.yml on matin/garth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
garth-0.6.3.tar.gz -
Subject digest:
519d4b532944638652bb740ee44dcf36e1d234321aecf085edd7f1a81ea66f69 - Sigstore transparency entry: 829332631
- Sigstore integration time:
-
Permalink:
matin/garth@24ec4b4b1e0b0c5c5066f644ba10de76e74272bb -
Branch / Tag:
refs/tags/0.6.3 - Owner: https://github.com/matin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@24ec4b4b1e0b0c5c5066f644ba10de76e74272bb -
Trigger Event:
release
-
Statement type:
File details
Details for the file garth-0.6.3-py3-none-any.whl.
File metadata
- Download URL: garth-0.6.3-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a02b323bf3cad5950594a1a8fc172a5ebed5b151223d261cefd199260b997f5
|
|
| MD5 |
d3a9cdeb9b4624b26a3af6c12bdea956
|
|
| BLAKE2b-256 |
1f3e050303556452f2bd5b235568c13013ead94458565f1664ea3494fc1ad1d1
|
Provenance
The following attestation bundles were made for garth-0.6.3-py3-none-any.whl:
Publisher:
publish.yml on matin/garth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
garth-0.6.3-py3-none-any.whl -
Subject digest:
9a02b323bf3cad5950594a1a8fc172a5ebed5b151223d261cefd199260b997f5 - Sigstore transparency entry: 829332633
- Sigstore integration time:
-
Permalink:
matin/garth@24ec4b4b1e0b0c5c5066f644ba10de76e74272bb -
Branch / Tag:
refs/tags/0.6.3 - Owner: https://github.com/matin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@24ec4b4b1e0b0c5c5066f644ba10de76e74272bb -
Trigger Event:
release
-
Statement type: