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()andupload_hiking_workout()now raiseValueError. Garmin has no walking or hiking workout sport type, so these workouts were stored without one.WalkingWorkoutandHikingWorkoutcan still be imported. - Tests that patch internals:
_fmt_ts_utcis now patched atgarminconnect.api.womens_health._fmt_ts_utc. Every other import path still works. - Windows:
tzdatais 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()andnow(). Useapi.today()instead ofdate.today()when asking for today's data. - More options on existing methods (all optional): filters and sorting for
get_workouts(),limit/start/statusforget_training_plans(), history options forget_personal_record(),aggregationforget_endurance_score()andget_max_metrics_range(), and a device id forrequest_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:
Garminis now built from one module per data domain ingarminconnect.api, andgarminconnect.clientis a package split by concern (login, session, tokens, transport). Duplicated login code was merged into shared helpers.from garminconnect import ...andfrom garminconnect.client import ...keep working.
Fixed
- Gear and duplicate uploads:
get_gear_activities()andget_gear_stats()return their empty result on a 404 instead of raising, andimport_activity()recognizes a duplicate upload. HTTP errors now keep their response. (#470) - Login on plain
requestssessions: the+requestslogin 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
/homeis 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()rejectsTrue/False, NaN and infinity.get_progress_summary_between_dates()sendstrue/falselike the web app, instead ofTrue/False.- Missing
curl_cffi: login says up front which strategies are unavailable, and the final error namescurl_cffias 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