This script simplifies the process of downloading activities from Strava and uploading them to TrainingPeaks in assisted mode.
The idea for this script came from the need to synchronize my triathlon training data from my Samsung Watch to TrainingPeaks, a platform not directly compatible with my watch. The script streamlines this process by leveraging Strava as an intermediary.
- Downloads activities from Strava based on activity IDs.
- Assisted mode for choosing the sport and activity download/upload options.
- Formats TCX files for specific sports like swimming.
- Validates TCX files for running and biking activities.
- Indents TCX files for better readability.
Watch the video guide on exporting from Strava to TrainingPeaks manually
- Choose the sport you want to export;
- Do you want to download the
.tcx
file or select from the local directory;- User chooses the ID of the activity on Strava;
- The download is performed by accessing the activity route with
/export_original
or/export_tcx
endpoints;
- If it is swimming or something else, the
.tcx
file is formatted; if it is running or biking, the.tcx
file is validated; - Indent the
.tcx
file.
- Python 3.6 or higher installed;
- Pip installed;
- Logged into your Strava account in your preferred browser.
- Clone the repository;
git clone https://github.com/Lucs1590/strava-to-trainingpeaks
- Navigate to the project directory:
cd strava-to-trainingpeaks
- Install the dependencies;
pip install -r requirements.txt
- Install the package globally;
pip install .
- Run the project globally;
strava-to-trainingpeaks
Follow the on-screen instructions after running the script. You'll be prompted to choose the sport, select activity download options, and provide the file path if necessary.
To package the application into an executable using cx_Freeze
, follow step:
- Run the following command to create an executable:
python exec_setup.py build
The executable will be created in the build
directory.
To run the project using Docker, follow these steps:
- Build the Docker image by running the following command in the root directory of the project:
docker build -t strava-to-trainingpeaks .
- Run the Docker container using the following command:
docker run -it --rm strava-to-trainingpeaks
This will create a Docker container for the project, allowing it to be run in a consistent environment without manual setup.
To use the interactive setup script, follow these steps:
- Run the interactive setup script:
python interactive_setup.py
-
Follow the on-screen instructions to choose your preferred setup method (global installation, virtual environment, Docker).
-
The script will guide you through the installation process, automate virtual environment creation, and install dependencies.
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository.
- Create a new branch for your feature (
git checkout -b my-feature
). - Commit your changes (
git commit -m 'feat: My new feature'
). - Push to the branch (
git push origin my-feature
). - Create a new Pull Request.