Local one-command Python tool to export FIT files from OneLap and incrementally upload to Strava.
This project runs with direct OneLap HTTP + Strava HTTP adapters.
- Create and activate virtual environment.
- Install dependencies:
pip install -r requirements-dev.txt
- Copy
.env.exampleto.envand fill required values.
Required .env keys for runtime:
ONELAP_USERNAMEONELAP_PASSWORDSTRAVA_CLIENT_IDSTRAVA_CLIENT_SECRETSTRAVA_REFRESH_TOKENSTRAVA_ACCESS_TOKENSTRAVA_EXPIRES_ATDEFAULT_LOOKBACK_DAYS
- One-time OneLap credential init:
onelap-sync --onelap-auth-init - Interactively prompts for username and password (password input is hidden).
- Saves
ONELAP_USERNAMEandONELAP_PASSWORDto.env.
- Create Strava API app and get
client_id+client_secret.- In the Strava API app settings, set Authorization Callback Domain to
localhost.
- In the Strava API app settings, set Authorization Callback Domain to
- Complete an OAuth authorization flow to obtain
refresh_token. - Save credentials in
.env.
- One-time Strava auth init:
onelap-sync --strava-auth-init - This flow requests
read,activity:writeand writes tokens to.env. - During normal runs, refreshed Strava tokens are automatically persisted back to
.env.
- OneLap HTTP prerequisites:
- OneLap account can sign in at
https://www.onelap.cn - Strava OAuth tokens are valid in
.env
- OneLap account can sign in at
- Recommended global command install:
pipx install onelap-strava-sync
- Default lookback run:
onelap-sync
- Run with explicit start date:
onelap-sync --since 2026-03-01
- Download FIT files from OneLap without uploading to Strava:
onelap-sync --download-only --since 2026-03-01
- In this mode, Strava keys are not required.
- Example output:
2026-03-09T08:00:00Z a2.fitdownload-only fetched X -> downloaded Y -> failed Z
- Use ISO date format:
YYYY-MM-DD - Example:
onelap-sync --since 2026-03-01
Repo-local fallback command: python run_sync.py
- Runtime code remains in root source directories.
- Skill distribution moved to standalone repo:
C:/Users/13247/Documents/Code Project/sync_onelap_strava_agent_skills. - Mapping note and migration context:
docs/skills-mapping.md. - Developer maintenance guide:
CONTRIBUTING.md.
- If import errors happen, confirm dependencies are installed in the active virtual environment.
- If Strava upload fails with 5xx, rerun; retriable errors use bounded backoff.
- If sync reports failed uploads, check
logs/sync.log; each failure line includes Stravastatusanderrordetails. - If OneLap risk control triggers, wait and rerun later.
- If OneLap HTTP returns 401, verify username/password in
.env. - If OneLap HTTP returns 4xx/5xx repeatedly, verify endpoint reachability and retry later.