A lightweight Python script that parses GPX running files and exports key metrics to a CSV file. Drop your .gpx files into a folder, run the script, and get a clean summary of every run — without reprocessing files you've already analysed.
Speed (km/h)
speed = distance_km / (moving_time_seconds / 3600)
Average Pace (seconds/km)
pace = moving_time_seconds / distance_km
Calorie Estimate
calories = distance_km * weight_kg * (1.0 + speed * 0.02)
The intensity factor (1.0 + speed * 0.02) scales calories upward at higher speeds to reflect the increased effort of running faster. For example, at 10 km/h the multiplier is 1.2; at 12 km/h it is 1.24.
| Column | Description |
|---|---|
| Date | Run date, extracted from GPS timestamps in the file |
| Dist (km) | Total flat distance in kilometres |
| Moving Time | Time spent moving (HH:MM:SS), excluding stops |
| Avg Pace | Average pace in MM:SS per kilometre |
| Calories | Estimated calories burned |
| Filename | GPX filename (used internally to track processed files) |
python gpx_run_analyser.py
On each run, the script will:
- Skip any files already recorded in the CSV
- Analyse only new
.gpxfiles - Append results to the CSV, sorted by date (most recent first)
- Print your 5 most recent runs to the terminal
Each .gpx file contains GPS track points with embedded timestamps, coordinates, and elevation data. The script:
- Parses each file using
gpxpy - Extracts moving time by ignoring periods where speed drops below 1.0 m/s
- Calculates flat distance from 2D coordinates
- Reads the run date from the first GPS timestamp in the file
- Estimates calories based on distance, speed, and athlete weight
- Saves results to a CSV, recording the filename to avoid duplicate processing on future runs
Date Dist (km) Avg Pace Calories
2026-02-20 8.30 5:12 621
2026-02-17 5.10 5:28 374
2026-02-14 10.05 5:05 768
- You must set
WEIGHT_KGandDATA_DIRbefore running the script. - Files are tracked by filename. Renaming a processed file will cause it to be analysed again.