A powerful tool that simplifies downloading activities from Strava and uploading them to TrainingPeaks, with optional AI-powered training analysis and multi-athlete coach mode.
Originally created to sync triathlon training data from Samsung Watch to TrainingPeaks (via Strava as an intermediary), this tool has evolved to include:
- Personal Mode: Individual athletes can download and process their own activities
- Coach Mode: Coaches can manage and sync activities for multiple athletes via OAuth
- AI Analysis: Optional LLM-powered training insights and performance feedback
- Audio Summaries: Generate spoken analysis of your training sessions
- π Download activities from Strava (running, cycling, swimming, and more)
- π Format TCX files for TrainingPeaks compatibility
- β Validate and optimize TCX data for different sports
- π― Interactive CLI with guided workflows
- π€ Intelligent training analysis using OpenAI's GPT models
- π Performance metrics evaluation (pace, heart rate, power, cadence)
- πͺ Identify strengths and areas for improvement
- π§ Generate audio summaries of your training sessions
- π₯ Manage multiple athletes from a single interface
- π Secure OAuth 2.0 authorization
- π Automatic token refresh
- π₯ Batch download activities for your athletes
For detailed guides and tutorials, check out these articles:
- π Strava to Training Peaks - Setup Guide
- π€ LLM to Strava: Intelligent Training Analysis with AI Co-coaching
Watch the video guide on exporting from Strava to TrainingPeaks manually
# Install the package
pip install .
# Run the interactive CLI
strava-to-trainingpeaksThe CLI will guide you through:
- Selecting your sport (running, cycling, swimming, other)
- Downloading from Strava or providing a local TCX file
- Optional AI analysis of your training session
- Optional audio summary generation
- Formatted TCX file ready for TrainingPeaks upload
# Set up OAuth credentials (one-time setup)
export STRAVA_CLIENT_ID=your_client_id
export STRAVA_CLIENT_SECRET=your_client_secret
# Run coach mode
strava-coach-modeSee Coach Mode Documentation for complete setup instructions.
- Python 3.12 or higher
- pip package manager
- Strava account (logged in on your browser for downloads)
- Optional: OpenAI API key (for AI analysis features)
# Clone the repository
git clone https://github.com/Lucs1590/strava-to-trainingpeaks
cd strava-to-trainingpeaks
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install .python interactive_setup.pyFollow the prompts to choose between:
- Global installation
- Virtual environment
- Docker container
# Build the image
docker build -t strava-to-trainingpeaks .
# Run the container
docker run -it --rm strava-to-trainingpeaksTo enable AI-powered training analysis:
- Get an OpenAI API key from OpenAI Platform
- Set the environment variable:
export OPENAI_API_KEY=your_api_key_hereOr create a .env file:
OPENAI_API_KEY=your_api_key_hereSee the Coach Mode Documentation for detailed OAuth setup instructions.
The tool can analyze your training sessions using advanced language models:
- Performance Metrics: Detailed analysis of pace, heart rate zones, power output, and cadence
- Physiological Analysis: Insights into cardiovascular efficiency and energy systems
- Strengths & Weaknesses: Identify what you're doing well and areas for improvement
- Training Plan Comparison: Compare actual performance against planned workouts
Example workflow:
strava-to-trainingpeaks
# Select sport β Download activity β Enable AI analysis β Answer promptsGenerate spoken summaries of your training analysis:
- Uses OpenAI's text-to-speech technology
- Automatically removes markdown formatting
- Saves MP3 files to your Downloads folder
- Perfect for reviewing while cooling down or commuting
Package the application into a standalone executable:
python exec_setup.py buildThe executable will be created in the build/ directory.
- Sport Selection: Choose your activity type (running, cycling, swimming, or other)
- Data Source: Download from Strava (by activity ID) or provide a local TCX file
- Processing: The tool formats and validates the TCX file for TrainingPeaks
- AI Analysis (optional): Get detailed performance insights
- Audio Summary (optional): Generate a spoken analysis
- Output: Receive a formatted TCX file ready for TrainingPeaks upload
- Setup: Configure Strava OAuth credentials (one-time)
- Athlete Authorization: Athletes grant access through secure OAuth flow
- Manage Athletes: View all authorized athletes and their token status
- Sync Activities: Download any athlete's activities using their tokens
- Batch Processing: Process multiple athletes' data efficiently
- π Strava to Training Peaks - Complete Guide
- π€ AI-Powered Training Analysis with LLM Integration
- π₯ Video: Manual Export from Strava to TrainingPeaks
- Author: Lucas Brito
- Repository: github.com/Lucs1590/strava-to-trainingpeaks
- License: MIT License - see LICENSE file
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Install development dependencies
pip install -r requirements.txt
# Run tests
python -m unittest discover -s tests -v
# Run with coverage
pytest --cov --junitxml=junit.xmlIf you find this project helpful, please consider:
- β Starring the repository
- π’ Sharing it with your training community
- π Reporting bugs or suggesting features via Issues
- π‘ Contributing code improvements
Special thanks to the open-source community and all contributors who have helped improve this project.
