github cyberjunky/python-garminconnect 0.3.19
Release 0.3.19

4 hours ago

What's Changed

This release adds the endpoints the Garmin Connect web app uses (340+ methods in total), plus edit calls for gear, goals, zones and settings. It also makes "today" follow your Garmin profile timezone and splits the package into one module per domain. Existing imports keep working.

⚠️ Upgrade notes

  • Timezone: dates and timestamps the library fills in itself, and timestamps you pass without an offset, now use your Garmin profile timezone instead of the machine's. Nothing changes when the two are the same. On a host running in UTC (common for Home Assistant and servers), "today" used to lag behind your real day every evening.
  • Walking and hiking workouts: upload_walking_workout() and upload_hiking_workout() now raise ValueError. Garmin has no walking or hiking workout sport type, so these workouts were stored without one. WalkingWorkout and HikingWorkout can still be imported.
  • Tests that patch internals: _fmt_ts_utc is now patched at garminconnect.api.womens_health._fmt_ts_utc. Every other import path still works.
  • Windows: tzdata is a new dependency there (needed for timezone support).

Added

  • Web-app endpoints: the library was compared with every call the Garmin Connect web app makes, and the missing ones were added. Each new method's exact request, and whether it was verified on a live account, is in docs/API_ENDPOINTS.md. Highlights:
    • Performance: latest VO2 max, training readiness and weekly training status ranges, heat/altitude acclimation, cycling ability, running economy, stamina and power curves, critical swim speed, fitness age v2.
    • Daily statistics: get_daily_summaries() for a date range in one call, daily and weekly series for heart rate, stress, Body Battery, intensity minutes, respiration, floors, hydration and calories, lifetime totals.
    • Wellness: SpO2 with acclimation, sleep-service sleep, naps, sleep statistics, Health Snapshot sessions, ECG (ghs.connect.garmin.com), sync timestamp, usage indicators.
    • Weight & blood pressure: latest/first weight, weekly weight and blood pressure, last reading per day.
    • Activities: search_activities() with the web app's full filter set, fastest splits, favorites, laps, rounds, swim/jump/step details, polyline, segments.
    • Gear & devices: gear v2 list/details/types, all/historical/active devices, sensors, device message queue, solar gain.
    • Workouts, plans, calendar, courses: scheduled workouts by period (includes adaptive plans), copy/reschedule workouts, plan tasks and catalogue, calendar events, courses, PDF report export.
  • Edit calls, each checked live:
    • update_gear() / delete_gear(): gear notes can finally be edited, and the v2 reads return them (issue 420).
    • update_activity().
    • update_blood_pressure() (changes the note).
    • set_steps_goal(), set_daily_goal().
    • update_heart_rate_zones(), update_power_zones().
    • update_user_settings(), set_primary_training_device().
    • Calendar notes: create, update, delete.
  • Timezone helpers: get_user_timezone(), today() and now(). Use api.today() instead of date.today() when asking for today's data.
  • More options on existing methods (all optional): filters and sorting for get_workouts(), limit/start/status for get_training_plans(), history options for get_personal_record(), aggregation for get_endurance_score() and get_max_metrics_range(), and a device id for request_reload().
  • GraphQL: the 53 operations the web dashboard sends are documented in docs/graphql_operations.md, for use with query_garmin_graphql().
  • Method reference in the README: every public method with its parameters and a one-line description, generated from the docstrings.
  • Demo: menu entries for the new read methods, a new "Activity Details & Courses" category, and entries for the edit calls that ask before writing.

Changed

  • Package layout: Garmin is now built from one module per data domain in garminconnect.api, and garminconnect.client is a package split by concern (login, session, tokens, transport). Duplicated login code was merged into shared helpers. from garminconnect import ... and from garminconnect.client import ... keep working.

Fixed

  • Gear and duplicate uploads: get_gear_activities() and get_gear_stats() return their empty result on a 404 instead of raising, and import_activity() recognizes a duplicate upload. HTTP errors now keep their response. (#470)
  • Login on plain requests sessions: the +requests login strategies and the JWT_WEB refresh no longer crash reading the JWT_WEB cookie.
  • Logging: an unexpected SSO login response is no longer written to the debug log, only its status.
  • Token storage: tokenstores work on systems where /home is a root-owned symlink (Fedora Silverblue, FreeBSD). Other symlinks are still rejected.
  • Retries: errors that can't succeed on retry fail at once instead of backing off through every retry.
  • Upload errors show Garmin's message, e.g. API Error 409 - Duplicate Activity., instead of a raw dict.
  • add_hydration_data() rejects True/False, NaN and infinity.
  • get_progress_summary_between_dates() sends true/false like the web app, instead of True/False.
  • Missing curl_cffi: login says up front which strategies are unavailable, and the final error names curl_cffi as the likely cause.
  • Demo: dates follow midnight and your profile timezone in a long-running session.

Thanks

  • @mifuha for the HTTP-response fix behind the gear and duplicate-upload handling (#470).
  • @thomas-fouret for the detailed gear-notes investigation (issue 420).

Full Changelog: 0.3.18...0.3.19

Don't miss a new python-garminconnect release

NewReleases is sending notifications on new releases.