You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-5Lines changed: 30 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
The Garmin Connect API demo (`example.py`) provides comprehensive access to **101 API methods** organized into **11 categories** for easy navigation:
4
4
5
+
Note: The demo menu is generated dynamically; exact options may change between releases.
6
+
5
7
```bash
6
8
$ ./example.py
7
9
🏃♂️ Garmin Connect API Demo - Main Menu
@@ -45,8 +47,8 @@ Make your selection:
45
47
46
48
-**Enhanced User Experience**: Categorized navigation with emoji indicators
47
49
-**Smart Data Management**: Interactive weigh-in deletion with search capabilities
48
-
-**Comprehensive Coverage**: All major Garmin Connect features accessible
49
-
-**Error Handling**: Robust error handling and user-friendly prompts
50
+
-**Comprehensive Coverage**: All major Garmin Connect features are accessible
51
+
-**Error Handling**: Robust error handling with user-friendly prompts
50
52
-**Data Export**: JSON export functionality for all data types
51
53
52
54
[](https://www.paypal.me/cyberjunkynl/)
@@ -71,7 +73,8 @@ Compatible with all Garmin Connect accounts. See <https://connect.garmin.com/>
71
73
Install from PyPI:
72
74
73
75
```bash
74
-
pip3 install garminconnect
76
+
python3 -m pip install --upgrade pip
77
+
python3 -m pip install garminconnect
75
78
```
76
79
77
80
## Run demo software (recommended)
@@ -81,7 +84,7 @@ python3 -m venv .venv --copies
81
84
source .venv/bin/activate # On Windows: .venv\Scripts\activate
82
85
pip install pdm
83
86
pdm install --group :example
84
-
./example.py
87
+
python3 ./example.py
85
88
```
86
89
87
90
@@ -178,6 +181,12 @@ garth.sso.OAUTH_CONSUMER = {
178
181
179
182
**Token Storage:**
180
183
Tokens are automatically saved to `~/.garminconnect` directory for persistent authentication.
184
+
For security, ensure restrictive permissions:
185
+
186
+
```bash
187
+
chmod 700 ~/.garminconnect
188
+
chmod 600 ~/.garminconnect/*2>/dev/null ||true
189
+
```
181
190
182
191
## 🧪 Testing
183
192
@@ -198,6 +207,14 @@ pdm run test # Run all tests
198
207
pdm run testcov # Run tests with coverage report
199
208
```
200
209
210
+
Optional: keep test tokens isolated
211
+
212
+
```bash
213
+
export GARMINTOKENS="$(mktemp -d)"
214
+
python3 ./example.py # create fresh tokens for tests
215
+
pdm run test
216
+
```
217
+
201
218
**Note:** Tests automatically use `~/.garminconnect` as the default token file location. You can override this by setting the `GARMINTOKENS` environment variable. Run `example.py` first to generate authentication tokens for testing.
202
219
203
220
**For Developers:** Tests use VCR cassettes to record/replay HTTP interactions. If tests fail with authentication errors, ensure valid tokens exist in `~/.garminconnect`
@@ -217,6 +234,14 @@ username = __token__
217
234
password = <PyPI_API_TOKEN>
218
235
```
219
236
237
+
# Recommended: use environment variables and restrict file perms
0 commit comments