1.x updates

This commit is contained in:
2026-05-19 08:34:22 -04:00
parent 3f3fce62d3
commit 9d91ac8ebc
53 changed files with 4541 additions and 2111 deletions

30
auth.py
View File

@@ -1,31 +1,5 @@
"""One-time login to Garmin Connect; saves OAuth tokens to .secrets/.
Usage:
uv run auth.py
Prompts for email + password (and MFA code if your account has 2FA).
Tokens are refreshed automatically by sync.py on subsequent runs
(valid ~1 year).
"""
import getpass
import os
from pathlib import Path
import garth
TOKEN_DIR = Path(__file__).parent / ".secrets"
def main() -> None:
TOKEN_DIR.mkdir(exist_ok=True)
email = os.environ.get("GARMIN_EMAIL") or input("Garmin email: ").strip()
password = os.environ.get("GARMIN_PASSWORD") or getpass.getpass("Garmin password: ")
garth.login(email, password)
garth.save(TOKEN_DIR)
profile = garth.client.username
print(f"Logged in as {profile}. Tokens saved to {TOKEN_DIR}.")
"""Shim — see openrun.ingest.auth."""
from openrun.ingest.auth import main
if __name__ == "__main__":
main()