garth  by matin

Python client for Garmin Connect, enabling data extraction and analysis

created 2 years ago
557 stars

Top 58.4% on sourcepulse

GitHubView on GitHub
Project Summary

This Python library provides a client for the Garmin Connect API, enabling users to programmatically access and analyze their health and fitness data. It targets developers and data enthusiasts who want to leverage their Garmin data beyond the official app, offering robust authentication and direct JSON responses from API endpoints.

How It Works

Garth utilizes OAuth1 and OAuth2 for authentication, ensuring compatibility with environments like Google Colab without requiring external tools like Cloudscraper. It directly interfaces with Garmin Connect's mobile API endpoints, returning structured JSON data instead of requiring HTML parsing. The library includes automatic token refresh and supports Multi-Factor Authentication (MFA).

Quick Start & Requirements

  • Install: python -m pip install garth
  • Authentication: Use uvx garth login or programmatically via garth.login(email, password). Session can be saved and resumed.
  • Prerequisites: Python 3.7+

Highlighted Details

  • Robust authentication supporting MFA and auto-refreshing tokens.
  • Direct JSON API access, bypassing HTML parsing.
  • Pydantic models for data validation and ease of use.
  • Comprehensive test coverage.
  • Examples provided for accessing daily sleep, stress, steps, HRV, and user profile data.

Maintenance & Community

The project is maintained by matin. Further community engagement details are not explicitly provided in the README.

Licensing & Compatibility

The README does not specify a license. Compatibility for commercial use or closed-source linking is not detailed.

Limitations & Caveats

Garmin does not accept uploads of structured FIT files; only FIT files generated from workouts are supported. The garth-mcp-server component is noted as being in early development.

Health Check
Last commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
109 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.