Skip to main content

Garmin SSO auth + Connect client

Project description

Garth

CI codecov PyPI version PyPI - Downloads Documentation

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_HOME or GARTH_TOKEN environment 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

Star History Chart

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

garth-0.6.3.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garth-0.6.3-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

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

Hashes for garth-0.6.3.tar.gz
Algorithm Hash digest
SHA256 519d4b532944638652bb740ee44dcf36e1d234321aecf085edd7f1a81ea66f69
MD5 96e08482873afe7a0513cc0b88759a69
BLAKE2b-256 20887b9cb1bd266acdab2b83444e6271ed1655d097713ef00b5f2c99ddb8f9c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for garth-0.6.3.tar.gz:

Publisher: publish.yml on matin/garth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for garth-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9a02b323bf3cad5950594a1a8fc172a5ebed5b151223d261cefd199260b997f5
MD5 d3a9cdeb9b4624b26a3af6c12bdea956
BLAKE2b-256 1f3e050303556452f2bd5b235568c13013ead94458565f1664ea3494fc1ad1d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for garth-0.6.3-py3-none-any.whl:

Publisher: publish.yml on matin/garth

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