Skip to content

Commit 4addc9a

Browse files
committed
Small fixes
1 parent f5d1d19 commit 4addc9a

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

README.md

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

55
- **`example.py`** - Simple getting-started example showing authentication, token storage, and basic API calls
6-
- **`demo.py`** - Comprehensive demo providing access to **101 API methods** organized into **11 categories** for easy navigation
6+
- **`demo.py`** - Comprehensive demo providing access to **100+ API methods** organized into **11 categories** for easy navigation
77

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

@@ -32,7 +32,7 @@ Make your selection:
3232

3333
## API Coverage Statistics
3434

35-
- **Total API Methods**: 101 unique endpoints (snapshot)
35+
- **Total API Methods**: 100+ unique endpoints (snapshot)
3636
- **Categories**: 11 organized sections
3737
- **User & Profile**: 4 methods (basic user info, settings)
3838
- **Daily Health & Activity**: 8 methods (today's health data)
@@ -57,7 +57,7 @@ Make your selection:
5757
[![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=for-the-badge&logo=paypal)](https://www.paypal.me/cyberjunkynl/)
5858
[![Sponsor on GitHub](https://img.shields.io/badge/Sponsor-GitHub-red.svg?style=for-the-badge&logo=github)](https://github.com/sponsors/cyberjunky)
5959

60-
A comprehensive Python 3 API wrapper for Garmin Connect, providing access to health, fitness, and device data.
60+
A comprehensive Python3 API wrapper for Garmin Connect, providing access to health, fitness, and device data.
6161

6262
## 📖 About
6363

example.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,19 @@ def safe_api_call(api_method, *args, **kwargs):
103103
else:
104104
return False, None, f"HTTP error: {e}"
105105

106-
except (
107-
FileNotFoundError,
108-
GarminConnectAuthenticationError,
109-
GarminConnectConnectionError,
110-
):
106+
except FileNotFoundError:
111107
return (
112108
False,
113109
None,
114-
"No valid tokens found. Please run with your email/password credentials to create new tokens.",
110+
"No valid tokens found. Please login with your email/password to create new tokens.",
115111
)
116112

113+
except GarminConnectAuthenticationError as e:
114+
return False, None, f"Authentication issue: {e}"
115+
116+
except GarminConnectConnectionError as e:
117+
return False, None, f"Connection issue: {e}"
118+
117119
except GarminConnectTooManyRequestsError as e:
118120
return False, None, f"Rate limit exceeded: {e}"
119121

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ publish = {composite = ["build", "pdm publish"]}
163163

164164
# VCR cassette management
165165
record-vcr = {env = {GARMINTOKENS = "~/.garminconnect"}, cmd = "pdm run pytest tests/test_garmin.py -v --vcr-record=new_episodes"}
166-
clean-vcr = "rm -f tests/cassettes/*.yaml"
166+
clean-vcr = "python3 -c \"import pathlib; p=pathlib.Path('tests/cassettes'); [f.unlink() for f in p.glob('*.yaml')]\""
167167
reset-vcr = {composite = ["clean-vcr", "record-vcr"]}
168168

169169
# Quality checks

0 commit comments

Comments
 (0)