Skip to content

znelson/moto-gpx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moto-gpx

Manage motorcycle ride GPX files from multiple sources — download from rever.co, import local GPX files, and view ride statistics.

Setup

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Usage

# 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 stats

Commands

rever

Discover 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

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.

stats

Show ride database statistics including records, time period breakdowns, and per-source counts.

Flag Default Description
--db rides.db Path to SQLite database

Architecture

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.

Ride IDs

Source ID format Example
Rever rever-{numeric_id} rever-11068508
Imported file {source}-{content_hash} file-a1b2c3d4
OnX (imported) onx-{content_hash} onx-f9e8d7c6

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages