Manage motorcycle ride GPX files from multiple sources — download from rever.co, import local GPX files, and view ride statistics.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt# Download all rides from Rever (first run)
python moto_gpx.py rever --full
# Incremental Rever sync (only new rides)
python moto_gpx.py rever
# Import local GPX files
python moto_gpx.py import ride.gpx
python moto_gpx.py import /path/to/gpx/files/
python moto_gpx.py import --source onx exported_rides/
# View ride statistics
python moto_gpx.py statsDiscover and download rides from rever.co. On first run, prompts for your email and password and saves the session to config.json.
| Flag | Default | Description |
|---|---|---|
--full |
off | Scan all pages (default stops early when it hits known rides) |
--discover-only |
off | Find rides but skip GPX downloads |
--download-only |
off | Download GPX for already-discovered rides only |
--simple-gpx |
off | Download basic GPX from Rever instead of building from GeoJSON |
--delay |
1.0 |
Seconds to wait between requests |
--output-dir |
gpx/ |
Directory to save GPX files |
--db |
rides.db |
Path to SQLite database |
--config |
config.json |
Path to Rever config file |
Import GPX files from local files or directories. Files are copied into the output directory and tracked in the database.
| Argument/Flag | Default | Description |
|---|---|---|
paths |
(required) | GPX files or directories to import |
--source |
file |
Source tag (e.g. file, onx, garmin) |
--output-dir |
gpx/ |
Directory to copy GPX files into |
--db |
rides.db |
Path to SQLite database |
Each imported file gets an ID like {source}-{content_hash}, so re-importing the same file is a no-op.
Show ride database statistics including records, time period breakdowns, and per-source counts.
| Flag | Default | Description |
|---|---|---|
--db |
rides.db |
Path to SQLite database |
moto_gpx.py — Main CLI: stats, import, and command dispatch
rever.py — Rever.co API client: auth, discovery, GeoJSON, GPX building
Each source (Rever, OnX, etc.) gets its own module. The main script handles the database, import, stats, and CLI routing.
| Source | ID format | Example |
|---|---|---|
| Rever | rever-{numeric_id} |
rever-11068508 |
| Imported file | {source}-{content_hash} |
file-a1b2c3d4 |
| OnX (imported) | onx-{content_hash} |
onx-f9e8d7c6 |