Skip to content

Commit

Permalink
Merge pull request #36 from jhurl3y/master
Browse files Browse the repository at this point in the history
Update version + README
  • Loading branch information
cyberjunky authored Jan 20, 2021
2 parents 8b12757 + c314328 commit c3b6f2b
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 2 deletions.
145 changes: 144 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
"""
Expand All @@ -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()
```
2 changes: 1 addition & 1 deletion garminconnect/__version__.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit c3b6f2b

Please sign in to comment.