- packaging/: PyInstaller spec (one folder, windowed, Python included), Inno Setup script (per-user install, Start menu, optional desktop icon, WebView2 check), build.ps1, app icon. - Bundled exe also runs the CLI (output to %LOCALAPPDATA%\myGarmin\cli.log). - Fix: .gitignore pattern dashboard*.html also hid src/mygarmin/report/dashboard.html, so the template was never committed and fresh clones could not build a dashboard. Patterns anchored; data file types (*.gpx, *.csv, *.json, *.gz, *.log) ignored too. - Self-test runs beside an open app (own WebView2 data folder, no single-instance check). - Neutral example values in a docstring and the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
72 lines
4.0 KiB
Markdown
72 lines
4.0 KiB
Markdown
# myGarmin
|
|
|
|
A local-first logbook for your activity and health history. It collects data from Garmin (watch over USB, Connect
|
|
account export, Connect API), Strava (account export) and AlpineQuest (.trk), keeps the original files in one library
|
|
folder, and builds a self-contained HTML dashboard plus GPX and AlpineQuest exports.
|
|
|
|
Everything stays on your PC: there is no server and no account, and nothing is uploaded anywhere.
|
|
|
|
> Status: early (phase 0/1 of [docs/PLAN.md](docs/PLAN.md)), command line only. A desktop window and installer come next.
|
|
|
|
## Install
|
|
**Windows:** download `myGarmin-setup-<version>.exe` from the releases page and run it. No admin rights or Python needed;
|
|
it installs for your user only and adds myGarmin to the Start menu. The app window needs Microsoft Edge WebView2,
|
|
which Windows 11 includes (setup checks and points you to Microsoft's download if it is missing).
|
|
Uninstalling removes the program only; your library folder stays where you put it.
|
|
|
|
**From source** (any OS with Python 3.12 or newer; the app window and watch-over-USB are Windows-first):
|
|
```
|
|
pip install -e . # from a checkout of this repo
|
|
pip install -e ".[api]" # also the Garmin Connect API (optional)
|
|
```
|
|
|
|
## Use
|
|
```
|
|
mygarmin init D:\myGarmin --name Sam --birth-year 1985 --sex F --tz Europe/London
|
|
mygarmin import D:\myGarmin <garmin_export.zip> <strava_export.zip> <folder of .fit/.tcx/.gpx/.trk>
|
|
mygarmin build D:\myGarmin # -> D:\myGarmin\dashboard.html and all_activities.csv
|
|
mygarmin export D:\myGarmin # -> exports\tracks_gpx.zip and tracks_trk.zip (one track per outing, by year)
|
|
```
|
|
Keeping it up to date:
|
|
```
|
|
mygarmin watch D:\myGarmin # Windows: read a Garmin watch connected by USB
|
|
mygarmin login D:\myGarmin # once: log in to Garmin Connect (password + MFA code)
|
|
mygarmin sync D:\myGarmin # new activities and daily health from Garmin Connect
|
|
mygarmin update D:\myGarmin # all of the above + build + export
|
|
```
|
|
|
|
### Where to get your data
|
|
| Source | How |
|
|
|---|---|
|
|
| Garmin Connect | garmin.com → Account → Data Management → Export Your Data. Arrives by e-mail as a zip; import the zip as is. |
|
|
| Strava | strava.com → Settings → My Account → Download or Delete Your Account → Request your archive. Import the zip as is. |
|
|
| AlpineQuest | Copy the `.trk` files from the phone (AlpineQuest folder, `Landmarks`/`Tracks`). |
|
|
| Garmin watch | Connect by USB and run `mygarmin watch`, or copy the watch's `GARMIN` folder and import it. |
|
|
| Races | Optional `races.csv` in the library: `date,event,time[,km,age_grade,position,pb]` (km defaults to 5). |
|
|
|
|
## How it works
|
|
- Originals are copied unchanged into `<library>/originals/`; the SQLite database `myGarmin.db` and everything else can
|
|
be rebuilt from them. Importing the same file twice does nothing.
|
|
- One outing recorded by several sources (watch, phone, Strava) is kept once, preferring the watch.
|
|
Car/plane/train/boat trips and very short tracks are flagged and left out of the dashboard.
|
|
- Local times come from the file itself or the GPS position (offline time zone lookup).
|
|
- **The Garmin Connect API is unofficial** (python-garminconnect). Garmin has no personal API; this logs in the way the
|
|
Connect app does and can break when Garmin changes its login. Your login token is stored on your PC only. The export
|
|
zip and the watch over USB always work.
|
|
|
|
## Privacy
|
|
This repository never contains personal data. Your library folder holds your health data: keep it private.
|
|
|
|
## Development
|
|
`pip install -e ".[dev,app]"`, then `pytest` (tests use synthetic files only) and `mygarmin-app` for the window.
|
|
|
|
Build the Windows installer (needs `pip install pyinstaller` and Inno Setup 6):
|
|
```
|
|
powershell -ExecutionPolicy Bypass -File packaging\build.ps1 # -> build\installer\myGarmin-setup-<version>.exe
|
|
```
|
|
The bundled `myGarmin.exe` also runs the command line (`myGarmin.exe status <library>`); as it has no console, output
|
|
goes to `%LOCALAPPDATA%\myGarmin\cli.log`. `MYGARMIN_SELFTEST=<file>` makes the window write what it shows and close.
|
|
|
|
## Licence
|
|
MIT, see [LICENSE](LICENSE).
|