Skip to content

Commit 7e84b84

Browse files
committed
Update README with workout PR changes: fix API counts, add typed workouts docs
1 parent 8020127 commit 7e84b84

1 file changed

Lines changed: 44 additions & 7 deletions

File tree

README.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
The Garmin Connect API library comes with two examples:
1212

1313
- **`example.py`** - Simple getting-started example showing authentication, token storage, and basic API calls
14-
- **`demo.py`** - Comprehensive demo providing access to **105+ API methods** organized into **12 categories** for easy navigation
14+
- **`demo.py`** - Comprehensive demo providing access to **119+ API methods** organized into **12 categories** for easy navigation
1515

1616
Note: The demo menu is generated dynamically; exact options may change between releases.
1717

@@ -41,20 +41,20 @@ Make your selection:
4141

4242
## API Coverage Statistics
4343

44-
- **Total API Methods**: 105+ unique endpoints (snapshot)
44+
- **Total API Methods**: 119+ unique endpoints (snapshot)
4545
- **Categories**: 12 organized sections
4646
- **User & Profile**: 4 methods (basic user info, settings)
4747
- **Daily Health & Activity**: 9 methods (today's health data)
4848
- **Advanced Health Metrics**: 11 methods (fitness metrics, HRV, VO2, training readiness)
4949
- **Historical Data & Trends**: 9 methods (date range queries, weekly aggregates)
50-
- **Activities & Workouts**: 28 methods (comprehensive activity and workout management)
50+
- **Activities & Workouts**: 34 methods (comprehensive activity, workout management, typed workout uploads, scheduling)
5151
- **Body Composition & Weight**: 8 methods (weight tracking, body composition)
5252
- **Goals & Achievements**: 15 methods (challenges, badges, goals)
5353
- **Device & Technical**: 7 methods (device info, settings)
54-
- **Gear & Equipment**: 8 methods (gear management, tracking)
54+
- **Gear & Equipment**: 7 methods (gear management, tracking)
5555
- **Hydration & Wellness**: 9 methods (hydration, blood pressure, menstrual)
5656
- **System & Export**: 4 methods (reporting, logout, GraphQL)
57-
- **Training Plans**: 3 methods
57+
- **Training Plans**: 2 methods
5858

5959
### Interactive Features
6060

@@ -74,7 +74,7 @@ A comprehensive Python3 API wrapper for Garmin Connect, providing access to heal
7474
This library enables developers to programmatically access Garmin Connect data including:
7575

7676
- **Health Metrics**: Heart rate, sleep, stress, body composition, SpO2, HRV
77-
- **Activity Data**: Workouts, scheduled workouts, exercises, training status, performance metrics
77+
- **Activity Data**: Workouts, typed workout uploads (running, cycling, swimming, walking, hiking), workout scheduling, exercises, training status, performance metrics
7878
- **Device Information**: Connected devices, settings, alarms, solar data
7979
- **Goals & Achievements**: Personal records, badges, challenges, race predictions
8080
- **Historical Data**: Trends, progress tracking, date range queries
@@ -344,9 +344,46 @@ hr_data = client.get_heart_rates(_today)
344344
print(f"Resting HR: {hr_data.get('restingHeartRate', 'n/a')}")
345345
```
346346

347+
### Typed Workouts (Pydantic Models)
348+
349+
The library includes optional typed workout models for creating type-safe workout definitions:
350+
351+
```bash
352+
pip install garminconnect[workout]
353+
```
354+
355+
```python
356+
from garminconnect.workout import (
357+
RunningWorkout, WorkoutSegment,
358+
create_warmup_step, create_interval_step, create_cooldown_step,
359+
create_repeat_group,
360+
)
361+
362+
# Create a structured running workout
363+
workout = RunningWorkout(
364+
workoutName="Easy Run",
365+
estimatedDurationInSecs=1800,
366+
workoutSegments=[
367+
WorkoutSegment(
368+
segmentOrder=1,
369+
sportType={"sportTypeId": 1, "sportTypeKey": "running"},
370+
workoutSteps=[create_warmup_step(300.0)]
371+
)
372+
]
373+
)
374+
375+
# Upload and optionally schedule it
376+
result = client.upload_running_workout(workout)
377+
client.schedule_workout(result["workoutId"], "2026-03-20")
378+
```
379+
380+
**Available workout classes:** `RunningWorkout`, `CyclingWorkout`, `SwimmingWorkout`, `WalkingWorkout`, `HikingWorkout`, `MultiSportWorkout`, `FitnessEquipmentWorkout`
381+
382+
**Helper functions:** `create_warmup_step`, `create_interval_step`, `create_recovery_step`, `create_cooldown_step`, `create_repeat_group`
383+
347384
### Additional Resources
348385
- **Simple Example**: [example.py](https://raw.githubusercontent.com/cyberjunky/python-garminconnect/master/example.py) - Getting started guide
349-
- **Comprehensive Demo**: [demo.py](https://raw.githubusercontent.com/cyberjunky/python-garminconnect/master/demo.py) - All 105+ API methods
386+
- **Comprehensive Demo**: [demo.py](https://raw.githubusercontent.com/cyberjunky/python-garminconnect/master/demo.py) - All 119+ API methods
350387
- **API Documentation**: Comprehensive method documentation in source code
351388
- **Test Cases**: Real-world usage examples in `tests/` directory
352389

0 commit comments

Comments
 (0)