Skip to content

Commit 2e99a5b

Browse files
committed
Add access to Fitness Age data by @fako1024
Add grouping option to progress summary and fix type annotations by @tboerstad
1 parent a2ebecb commit 2e99a5b

File tree

3 files changed

+46
-45
lines changed

3 files changed

+46
-45
lines changed

README.md

+37-36
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@ $ ./example.py
66
77
1 -- Get full name
88
2 -- Get unit system
9-
3 -- Get activity data for '2024-03-15'
10-
4 -- Get activity data for '2024-03-15' (compatible with garminconnect-ha)
11-
5 -- Get body composition data for '2024-03-15' (compatible with garminconnect-ha)
12-
6 -- Get body composition data for from '2024-03-08' to '2024-03-15' (to be compatible with garminconnect-ha)
13-
7 -- Get stats and body composition data for '2024-03-15'
14-
8 -- Get steps data for '2024-03-15'
15-
9 -- Get heart rate data for '2024-03-15'
16-
0 -- Get training readiness data for '2024-03-15'
17-
- -- Get daily step data for '2024-03-08' to '2024-03-15'
18-
/ -- Get body battery data for '2024-03-08' to '2024-03-15'
19-
! -- Get floors data for '2024-03-08'
20-
? -- Get blood pressure data for '2024-03-08' to '2024-03-15'
21-
. -- Get training status data for '2024-03-15'
22-
a -- Get resting heart rate data for 2024-03-15'
23-
b -- Get hydration data for '2024-03-15'
24-
c -- Get sleep data for '2024-03-15'
25-
d -- Get stress data for '2024-03-15'
26-
e -- Get respiration data for '2024-03-15'
27-
f -- Get SpO2 data for '2024-03-15'
28-
g -- Get max metric data (like vo2MaxValue and fitnessAge) for '2024-03-15'
9+
3 -- Get activity data for '2024-07-06'
10+
4 -- Get activity data for '2024-07-06' (compatible with garminconnect-ha)
11+
5 -- Get body composition data for '2024-07-06' (compatible with garminconnect-ha)
12+
6 -- Get body composition data for from '2024-06-29' to '2024-07-06' (to be compatible with garminconnect-ha)
13+
7 -- Get stats and body composition data for '2024-07-06'
14+
8 -- Get steps data for '2024-07-06'
15+
9 -- Get heart rate data for '2024-07-06'
16+
0 -- Get training readiness data for '2024-07-06'
17+
- -- Get daily step data for '2024-06-29' to '2024-07-06'
18+
/ -- Get body battery data for '2024-06-29' to '2024-07-06'
19+
! -- Get floors data for '2024-06-29'
20+
? -- Get blood pressure data for '2024-06-29' to '2024-07-06'
21+
. -- Get training status data for '2024-07-06'
22+
a -- Get resting heart rate data for 2024-07-06'
23+
b -- Get hydration data for '2024-07-06'
24+
c -- Get sleep data for '2024-07-06'
25+
d -- Get stress data for '2024-07-06'
26+
e -- Get respiration data for '2024-07-06'
27+
f -- Get SpO2 data for '2024-07-06'
28+
g -- Get max metric data (like vo2MaxValue and fitnessAge) for '2024-07-06'
2929
h -- Get personal record for user
3030
i -- Get earned badges for user
3131
j -- Get adhoc challenges data from start '0' and limit '100'
@@ -34,38 +34,39 @@ l -- Get badge challenges data from '1' and limit '100'
3434
m -- Get non completed badge challenges data from '1' and limit '100'
3535
n -- Get activities data from start '0' and limit '100'
3636
o -- Get last activity
37-
p -- Download activities data by date from '2024-03-08' to '2024-03-15'
37+
p -- Download activities data by date from '2024-06-29' to '2024-07-06'
3838
r -- Get all kinds of activities data from '0'
3939
s -- Upload activity data from file 'MY_ACTIVITY.fit'
4040
t -- Get all kinds of Garmin device info
4141
u -- Get active goals
4242
v -- Get future goals
4343
w -- Get past goals
4444
y -- Get all Garmin device alarms
45-
x -- Get Heart Rate Variability data (HRV) for '2024-03-15'
46-
z -- Get progress summary from '2024-03-08' to '2024-03-15' for all metrics
45+
x -- Get Heart Rate Variability data (HRV) for '2024-07-06'
46+
z -- Get progress summary from '2024-06-29' to '2024-07-06' for all metrics
4747
A -- Get gear, the defaults, activity types and statistics
48-
B -- Get weight-ins from '2024-03-08' to '2024-03-15'
49-
C -- Get daily weigh-ins for '2024-03-15'
50-
D -- Delete all weigh-ins for '2024-03-15'
51-
E -- Add a weigh-in of 89.6kg on '2024-03-15'
52-
F -- Get virtual challenges/expeditions from '2024-03-08' to '2024-03-15'
53-
G -- Get hill score data from '2024-03-08' to '2024-03-15'
54-
H -- Get endurance score data from '2024-03-08' to '2024-03-15'
55-
I -- Get activities for date '2024-03-15'
48+
B -- Get weight-ins from '2024-06-29' to '2024-07-06'
49+
C -- Get daily weigh-ins for '2024-07-06'
50+
D -- Delete all weigh-ins for '2024-07-06'
51+
E -- Add a weigh-in of 89.6kg on '2024-07-06'
52+
F -- Get virtual challenges/expeditions from '2024-06-29' to '2024-07-06'
53+
G -- Get hill score data from '2024-06-29' to '2024-07-06'
54+
H -- Get endurance score data from '2024-06-29' to '2024-07-06'
55+
I -- Get activities for date '2024-07-06'
5656
J -- Get race predictions
57-
K -- Get all day stress data for '2024-03-15'
58-
L -- Add body composition for '2024-03-15'
57+
K -- Get all day stress data for '2024-07-06'
58+
L -- Add body composition for '2024-07-06'
5959
M -- Set blood pressure '120,80,80,notes='Testing with example.py'
6060
N -- Get user profile/settings
61-
O -- Reload epoch data for 2024-03-15
61+
O -- Reload epoch data for 2024-07-06
6262
P -- Get workouts 0-100, get and download last one to .FIT file
6363
R -- Get solar data from your devices
6464
S -- Get pregnancy summary data
65-
T -- Add hydration data (1 cup) for today
65+
T -- Add hydration data
66+
U -- Get Fitness Age data for 2024-07-06
6667
Z -- Remove stored login tokens (logout)
6768
q -- Exit
68-
Make your selection:
69+
Make your selection:
6970
```
7071

7172
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/cyberjunkynl/)

garminconnect/__init__.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -512,27 +512,27 @@ def add_hydration_data(
512512
cdate = str(raw_date)
513513

514514
raw_ts = datetime.now()
515-
timestamp = datetime.strftime(raw_ts, '%Y-%m-%dT%H:%M:%S.%f')
515+
timestamp = datetime.strftime(raw_ts, "%Y-%m-%dT%H:%M:%S.%f")
516516

517517
elif cdate is not None and timestamp is None:
518518
# If cdate is not null, use timestamp associated with midnight
519-
raw_ts = datetime.strptime(cdate, '%Y-%m-%d')
520-
timestamp = datetime.strftime(raw_ts, '%Y-%m-%dT%H:%M:%S.%f')
519+
raw_ts = datetime.strptime(cdate, "%Y-%m-%d")
520+
timestamp = datetime.strftime(raw_ts, "%Y-%m-%dT%H:%M:%S.%f")
521521

522522
elif cdate is None and timestamp is not None:
523523
# If timestamp is not null, set cdate equal to date part of timestamp
524-
raw_ts = datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%f')
524+
raw_ts = datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S.%f")
525525
cdate = str(raw_ts.date())
526526

527527
payload = {
528528
"calendarDate": cdate,
529529
"timestampLocal": timestamp,
530-
"valueInML": value_in_ml
531-
}
530+
"valueInML": value_in_ml,
531+
}
532532

533533
logger.debug("Adding hydration data")
534534

535-
return self.garth.put('connectapi', url, json=payload)
535+
return self.garth.put("connectapi", url, json=payload)
536536

537537
def get_hydration_data(self, cdate: str) -> Dict[str, Any]:
538538
"""Return available hydration data 'cdate' format 'YYYY-MM-DD'."""
@@ -761,7 +761,7 @@ def get_fitnessage_data(self, cdate: str) -> Dict[str, Any]:
761761
logger.debug("Requesting Fitness Age data")
762762

763763
return self.connectapi(url)
764-
764+
765765
def get_hill_score(self, startdate: str, enddate=None):
766766
"""
767767
Return hill score by day from 'startdate' format 'YYYY-MM-DD'

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "garminconnect"
3-
version = "0.2.18"
3+
version = "0.2.19"
44
description = "Python 3 API wrapper for Garmin Connect"
55
authors = [
66
{name = "Ron Klinkien", email = "[email protected]"},

0 commit comments

Comments
 (0)