garth-ng
Garmin SSO auth + Connect Python client — maintained fork of matin/garth
About this fork
garth-ng is a maintained continuation of the original garth library by
Matin Tamizi. The original project was deprecated
after Garmin changed their auth flow. This fork restores compatibility and
continues active development. The package name changed to garth-ng but the
import stays import garth — same as Pillow keeping from PIL import Image.
Migrating from garth
Both packages install into the same site-packages/garth/ directory. You
must uninstall the original first:
pip uninstall garth
pip install garth-ng
Your code stays unchanged. import garth works exactly as before.
Installation
pip install garth-ng
uv add garth-ng
The garth CLI command is included in the base install — no extras needed.
Quick Start
Login and save session
import garth
from getpass import getpass
garth.login(input("Email: "), getpass("Password: "))
garth.save("~/.garth")
MFA is handled automatically with a terminal prompt. Pass a custom handler if you need one:
garth.login(email, password, prompt_mfa=lambda: input("MFA code: "))
Resume a saved session
import garth
garth.resume("~/.garth")
print(garth.client.username)
Auto-load from environment
export GARTH_HOME=~/.garth
import garth
print(garth.client.username) # loaded automatically
Or use a base64 token (useful in CI/containers):
export GARTH_TOKEN="eyJvYXV0aF90b2tlbi..."
Generate a token with the CLI:
garth login
For China region:
garth --domain garmin.cn login
Direct API calls
sleep = garth.connectapi(
f"/wellness-service/wellness/dailySleepData/{garth.client.username}",
params={"date": "2023-07-05", "nonSleepBufferMinutes": 60},
)
Stats and data
# Daily steps for the last 7 days
garth.DailySteps.list(period=7)
# Stress levels
garth.DailyStress.list("2023-07-23", 2)
# Weekly HRV
garth.DailyHRV.list(period=7)
# Sleep quality
garth.DailySleep.list(period=7)
Available stat types: DailySteps, WeeklySteps, DailyStress,
WeeklyStress, DailyHRV, DailySleep, DailyHydration,
DailyIntensityMinutes, WeeklyIntensityMinutes, DailyTrainingStatus,
WeeklyTrainingStatus, MonthlyTrainingStatus
Available data types: SleepData, HRVData, WeightData, DailyHeartRate,
BodyBatteryData, DailyBodyBatteryStress, DailySleepData, DailySummary,
Activity, FitnessActivity, GarminScoresData, TrainingReadinessData,
MorningTrainingReadinessData
Upload an activity
with open("activity.fit", "rb") as f:
garth.upload(f)
Configuration
garth.configure(domain="garmin.cn") # China region
garth.configure(timeout=30) # Request timeout (seconds)
garth.configure(retries=5, backoff_factor=1.0) # Retry behavior
garth.configure(proxies={"https": "http://localhost:8888"}, ssl_verify=False) # Proxy
License
MIT. Original library by Matin Tamizi. Fork maintained by CyberFossa.
Release files for garth-ng 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| garth_ng-1.1.0.tar.gz | 2.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| garth_ng-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.1 MB
Release files / garth_ng-1.1.0.tar.gz
| Download URL | garth_ng-1.1.0.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
337434d0bddd58ac4889aeaa790e969e74a9db0ecaa6e5b38995fe1027f741d8
|
|
BLAKE2b-256 checksum How to use checksums |
822b39ea2248e77b7c97bdb81885a83317c15afaa6231f022d36c70a809045f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 12, 2026.
Transparency logRelease files / garth_ng-1.1.0-py3-none-any.whl
| Download URL | garth_ng-1.1.0-py3-none-any.whl |
|---|---|
| Size | 65.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d467fe736f559846cca6bb8db038204d3170fd3998c60b4d1fea92e28b3c6646
|
|
BLAKE2b-256 checksum How to use checksums |
d98b5fdd2388027ee8a759fdaebe7d743216a9fc72dce3b6937092a746d48e41
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Apr 12, 2026.
Transparency log