Skip to main content

Python 3 API wrapper for Garmin Connect

Project description

Python: Garmin Connect

Python 3 API wrapper for Garmin Connect to get your statistics.

About

This package allows you to request your activity and health data you gather on Garmin Connect. See https://connect.garmin.com/

Installation

pip install garminconnect

Usage

from datetime import date

from garminconnect import (
    Garmin,
    GarminConnectConnectionError,
    GarminConnectTooManyRequestsError,
    GarminConnectAuthenticationError,
)

today = date.today()
client = Garmin(YOUR_EMAIL, YOUR_PASSWORD)

"""
Login to portal using specified credentials
"""
try:
    client = Garmin(YOUR_EMAIL, YOUR_PASSWORD)
except (
    GarminConnectConnectionError,
    GarminConnectAuthenticationError,
    GarminConnectTooManyRequestsError,
)
as err:
    print("Error occured during Garmin Connect Client setup: %s", err)
    return
except Exception:  # pylint: disable=broad-except
    print("Unknown error occured during Garmin Connect Client setup")
    return

"""
Get full name
"""
print(client.get_full_name())

"""
Get unit system
"""
print(client.get_unit_system())

"""
Fetch activities data
"""
print(client.get_stats(today.isoformat()))

"""
Fetch logged heart rates
"""
print(client.get_heart_rates(today.isoformat()))

"""
Fetch body composition rates
"""
print(client.get_body_composition(today.isoformat()))

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

garminconnect-0.1.9.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file garminconnect-0.1.9.tar.gz.

File metadata

  • Download URL: garminconnect-0.1.9.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3

File hashes

Hashes for garminconnect-0.1.9.tar.gz
Algorithm Hash digest
SHA256 5a95384db79ca82ca9f3ad94c86216f06a7d66058270a816b3cb3edcea282ff4
MD5 a0e0748a66840f529b141381a4a3c77a
BLAKE2b-256 8248d72aad03941276d89f67d6a9250347957b7c573e5308bfc9f858409820db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page