From 44cb9e6a08b5f4109933602e3d388019be6869d3 Mon Sep 17 00:00:00 2001 From: James Hurley Date: Sun, 10 Jan 2021 14:23:00 +0000 Subject: [PATCH 1/2] Update version --- garminconnect/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/garminconnect/__version__.py b/garminconnect/__version__.py index 54155c3..76face3 100644 --- a/garminconnect/__version__.py +++ b/garminconnect/__version__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- """Python 3 API wrapper for Garmin Connect to get your statistics.""" -__version__ = "0.1.16" +__version__ = "0.1.17" From c3143284869d1c500e90558d8515355318eeb3b0 Mon Sep 17 00:00:00 2001 From: James Hurley Date: Sun, 10 Jan 2021 14:36:23 +0000 Subject: [PATCH 2/2] Update readme --- README.md | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4c0450..bbdb9ae 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ Python 3 API wrapper for Garmin Connect to get your statistics. This package allows you to request your device, activity and health data from your Garmin Connect account. See https://connect.garmin.com/ - ## Installation ```bash @@ -272,6 +271,110 @@ except Exception: # pylint: disable=broad-except quit() +first_activity_id = activities[0].get("activityId") +owner_display_name = activities[0].get("ownerDisplayName") + + +""" +Get activity splits +""" +print("client.get_activity_splits(%s)", first_activity_id) +print("----------------------------------------------------------------------------------------") +try: + splits = client.get_activity_splits(first_activity_id) + print(splits) +except ( + GarminConnectConnectionError, + GarminConnectAuthenticationError, + GarminConnectTooManyRequestsError, +) as err: + print("Error occurred during Garmin Connect Client get activity splits: %s" % err) + quit() +except Exception: # pylint: disable=broad-except + print("Unknown error occurred during Garmin Connect Client get activity splits") + quit() + + +""" +Get activity split summaries +""" +print("client.get_activity_split_summaries(%s)", first_activity_id) +print("----------------------------------------------------------------------------------------") +try: + split_summaries = client.get_activity_split_summaries(first_activity_id) + print(split_summaries) +except ( + GarminConnectConnectionError, + GarminConnectAuthenticationError, + GarminConnectTooManyRequestsError, +) as err: + print("Error occurred during Garmin Connect Client get activity split summaries: %s" % err) + quit() +except Exception: # pylint: disable=broad-except + print("Unknown error occurred during Garmin Connect Client get activity split summaries") + quit() + + +""" +Get activity split summaries +""" +print("client.get_activity_weather(%s)", first_activity_id) +print("----------------------------------------------------------------------------------------") +try: + weather = client.get_activity_weather(first_activity_id) + print(weather) +except ( + GarminConnectConnectionError, + GarminConnectAuthenticationError, + GarminConnectTooManyRequestsError, +) as err: + print("Error occurred during Garmin Connect Client get activity weather: %s" % err) + quit() +except Exception: # pylint: disable=broad-except + print("Unknown error occurred during Garmin Connect Client get activity weather") + quit() + + +""" +Get activity hr timezones +""" +print("client.get_activity_hr_in_timezones(%s)", first_activity_id) +print("----------------------------------------------------------------------------------------") +try: + hr_timezones = client.get_activity_hr_in_timezones(first_activity_id) + print(hr_timezones) +except ( + GarminConnectConnectionError, + GarminConnectAuthenticationError, + GarminConnectTooManyRequestsError, +) as err: + print("Error occurred during Garmin Connect Client get activity hr timezones: %s" % err) + quit() +except Exception: # pylint: disable=broad-except + print("Unknown error occurred during Garmin Connect Client get activity hr timezones") + quit() + + +""" +Get activity details +""" +print("client.get_activity_details(%s)", first_activity_id) +print("----------------------------------------------------------------------------------------") +try: + details = client.get_activity_details(first_activity_id) + print(details) +except ( + GarminConnectConnectionError, + GarminConnectAuthenticationError, + GarminConnectTooManyRequestsError, +) as err: + print("Error occurred during Garmin Connect Client get activity details: %s" % err) + quit() +except Exception: # pylint: disable=broad-except + print("Unknown error occurred during Garmin Connect Client get activity details") + quit() + + """ Get sleep data """ @@ -311,6 +414,26 @@ except Exception: # pylint: disable=broad-except quit() +""" +Get device last used +""" +print("client.get_device_last_used()") +print("----------------------------------------------------------------------------------------") +try: + device_last_used = client.get_device_last_used() + print(device_last_used) +except ( + GarminConnectConnectionError, + GarminConnectAuthenticationError, + GarminConnectTooManyRequestsError, +) as err: + print("Error occurred during Garmin Connect Client get device last used: %s" % err) + quit() +except Exception: # pylint: disable=broad-except + print("Unknown error occurred during Garmin Connect Client get device last used") + quit() + + """ Get device settings """ @@ -331,4 +454,24 @@ except ( except Exception: # pylint: disable=broad-except print("Unknown error occurred during Garmin Connect Client get device settings") quit() + + +""" +Get personal record +""" +print("client.get_personal_record()") +print("----------------------------------------------------------------------------------------") +try: + personal_record = client.get_personal_record(owner_display_name) + print(personal_record) +except ( + GarminConnectConnectionError, + GarminConnectAuthenticationError, + GarminConnectTooManyRequestsError, +) as err: + print("Error occurred during Garmin Connect Client get personal record: %s" % err) + quit() +except Exception: # pylint: disable=broad-except + print("Unknown error occurred during Garmin Connect Client get personal record") + quit() ```