ha-garmin
Python client for Garmin Connect API
What it is and what it does
ha-garmin is a Python client library for the Garmin Connect API, designed primarily for Home Assistant integration but usable as a standalone tool. It handles Garmin authentication (including MFA), session persistence, and automatic token refresh, then provides both high-level coordinator methods (optimized for Home Assistant's multi-coordinator pattern) and granular API methods to fetch health data (steps, heart rate, sleep, stress, body composition), activity records, training metrics, gear information, and device status. It also supports writing data back to Garmin—logging nutrition, hydration, blood pressure, and manual activities—though nutrition logging requires a Garmin Connect+ subscription.
The library abstracts away authentication complexity with automatic fallback strategies and midnight-aware data fetching (using yesterday's data when today isn't ready). It automatically transforms raw API responses with unit conversions (seconds to minutes, grams to kilograms) and nested field flattening. Runtime dependencies are lightweight: pydantic for data validation, curl_cffi and requests for HTTP calls.
Use it for:
- Build a Home Assistant integration that syncs daily Garmin health metrics (steps, HR, sleep) into automations and dashboards.
- Fetch activity records and training readiness scores to trigger workout reminders or recovery alerts.
- Log manual nutrition entries, hydration, or blood pressure measurements back to Garmin Connect from external apps.
- Download and archive activity files (FIT, GPX, TCX) for personal data backup or analysis.
- Monitor gear usage statistics and device battery/sync status across multiple Garmin devices.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client for the Garmin Connect API with support for authentication, token management, MFA, and fetching health and fitness data from Garmin devices.
Yes. The package is actively maintained, has no known vulnerabilities, uses permissive MIT licensing, and offers low install friction. It is well-suited for Home Assistant users and developers building Garmin integrations. The API surface is comprehensive and the library handles authentication and token management transparently. Start with it if you need Garmin Connect access in Python.
Install
ha-garmin on PyPI
pip
pip install ha-garminuv
uv add ha-garminpoetry
poetry add ha-garminInstalling ha-garmin
Before you install
Low install friction with a pure-Python wheel and only three runtime dependencies (pydantic, curl_cffi, requests). Active maintenance with a recent commit on 2026-08-13.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions.
Quickstart
pip install ha-garmin
import asyncio
from datetime import date
from ha_garmin import GarminAuth, GarminClient
auth = GarminAuth()
auth.login("email@example.com", "password")
client = GarminClient(auth)
async def fetch():
data = await client.fetch_core_data(date.today())
return data
asyncio.run(fetch())
Requires Python 3.11 or later. Authentication is synchronous; data fetches are async and must be awaited.
Verify before relying
- Whether the optional [ua] extra (improved browser UA generation) is necessary for reliable authentication in practice.
- Rate limit and retry behavior specifics beyond the stated backoff for 429 and 5xx responses.
- Whether Garmin Connect+ subscription is required for all write operations or only nutrition logging.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pydantic, curl_cffi, requests |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 114,100/month — #12,313 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ha_garmin-0.1.36-py3-none-any.whl
Keywords: garmin, garmin-connect, fitness, api, health
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
axisEstablishes connections to Axis Communications…
permissive · top 15,000 on PyPI
garminconnectPython wrapper for the Garmin Connect API that…
permissive · top 15,000 on PyPI
fit-toolReads and writes Garmin FIT files for Activity,…
permissive · top 15,000 on PyPI
garthGarth provides Python access to Garmin Connect…
permissive · top 15,000 on PyPI
fitparseParses ANT/Garmin .FIT binary files, extracting…
permissive · top 15,000 on PyPI
garmin-fit-sdkDecodes Garmin FIT (Flexible and Interoperable…
unclear · top 15,000 on PyPI
asyncsleepiqAsyncSleepIQ provides async Python access to…
permissive · top 15,000 on PyPI
total-connect-clientA Python client library for authenticating with…
permissive · top 15,000 on PyPI
aioharmonyaioharmony is an asyncio library for…
permissive · top 15,000 on PyPI
stravalibstravalib provides a Python client for…
permissive · top 15,000 on PyPI