Python tool for analyzing cycling FIT files. Generates distribution charts, statistics, and zone-based analysis for power, heart rate, and cadence. Includes Strava integration for downloading and analyzing rides directly from your account.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtTo use Strava integration features:
-
Create a Strava API Application
- Go to https://www.strava.com/settings/api
- Click "Create App"
- Fill in the required fields (the callback domain can be
localhost) - Note your Client ID and Client Secret
-
Create Configuration File
cat > .strava_config.json << EOF { "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" } EOF
-
Authorize the Application
python analyze_ride.py --strava-auth
This will open a browser for authorization and save your tokens.
For more details on creating a Strava app, see the Strava API documentation.
Analyze a single FIT file:
python analyze_ride.py <fit_file>Analyze all FIT files in current directory (timeseries):
python analyze_ride.py --timeseriesInteractive ride selection (browse by name):
python analyze_ride.py --strava-select # Single ride
python analyze_ride.py --strava-select-timeseries # Multi-select for trendsAnalyze by activity ID:
python analyze_ride.py --strava-activity 123456789Analyze recent rides:
python analyze_ride.py --strava-recent 5 # Last 5 rides
python analyze_ride.py --strava-timeseries 10 # Last 10 rides (trends)Creates a directory ride_YYYY-MM-DD/ containing:
Distribution Charts:
power_distribution.png- Power histogram with mean/medianheart_rate_distribution.png- HR histogram with mean/mediancadence_distribution.png- Cadence histogram with mean/median
Statistics Tables:
summary_stats.png- Combined table with mean, median, SD for all metricspower_stats.png- Detailed power statisticsheart_rate_stats.png- Detailed HR statisticscadence_stats.png- Detailed cadence statistics
Zone Analysis:
power_zones.png- Distribution across FTP-based training zonesheart_rate_zones.png- Distribution across max HR-based zones
Creates a timeseries_analysis/ directory containing:
timeseries_power.png- Power trends over time (mean, median, IQR, max)timeseries_heart_rate.png- Heart rate trends over timetimeseries_cadence.png- Cadence trends over time
Edit zones_config.json to set your FTP and max heart rate:
{
"ftp": 185,
"max_heart_rate": 195,
...
}- Z1 Recovery: 0-55%
- Z2 Endurance: 55-75%
- Z3 Tempo: 75-90%
- Z4 Threshold: 90-105%
- Z5 VO2Max: 105-120%
- Z6 Anaerobic: >120%
- Z1 Recovery: 0-60%
- Z2 Endurance: 60-70%
- Z3 Tempo: 70-80%
- Z4 Threshold: 80-90%
- Z5 Max: >90%