Convert workout data from Peloton into a TCX file that can be uploaded to Garmin.
- Fetch latest workouts from Peloton
- Convert Peloton workout to TCX file
- Upload TCX workout to Garmin
- Maintain Upload History to avoid duplicates in Garmin
- Find the latest release here
- Download the file
peloton-to-garmin-windows.zip
- Unzip the folder
- Find the file named
config.ini
, open it with your text editor of choice and modify the Peloton/Garmin settings - Save and close the file
- Find the file named
peloton-to-garmin.exe
, double click to launch the program - You will be prompted to enter how many workouts you would like to fetch
- A TCX file for each workout will be created in the
Output
directory - The resulting TCX file can then be uploaded to Garmin manually, or you can configure the
config.ini
settings to upload automagically for you
- Download the repo here
- Extract the zip file
- Install the latest version of Python 3
- Open
File Explorer
and navigate to the wherever you unzipped the downloaded project - Navigate so that you are inside the
peloton-to-garmin
folder - Open a command prompt by clicking in the
Location Bar
at the top and typingcmd
then hit enter - From the command prompt run the following command:
pip install -r requirements.txt
- Close the command prompt and return to the
peloton-to-garmin
folder - Edit the
config.ini
file and set your Peloton Email and Password, Save and Close- Optionally set your Garmin Email and Password if you wish for activities to be uploaded automatically
- Open a command prompt inside of the
peloton-to-garmin
folder - Run the following command:
python peloton-to-garmin
- You will be prompted to enter how many workouts you would like to fetch
- A TCX file for each workout will be created in the
output
directory - The resulting TCX file can then be uploaded to Garmin
wget https://github.com/philosowaffle/peloton-to-garmin/archive/master.zip
unzip master.zip
- Install Python 3
- Navigate so that you are inside the
peloton-to-garmin
folder - From the command prompt run the following command:
pip install -r requirements.txt
- In ubuntu 20.04, if you use the python3 in the repo, the command is
pip3 install -r requirements.txt
vim config.ini
(or nano or whatever. Just not emacs, please :P)- set your Peloton Email and Password, Save and Close
- Open a command prompt inside of the
peloton-to-garmin
folder - Run the following command:
python3 peloton-to-garmin.py
- You will be prompted to enter how many workouts you would like to fetch
- A TCX file for each workout will be created in the
output
directory - The resulting TCX file can then be uploaded to Garmin
This repository does not directly maintain support for running the code in a docker container, but @Octopusprime83 has created and published a container that can be pulled from docker hub. Note that some of the behavior in the container may differ from the latest code published on github.
docker pull philo138/peloton-to-garmin
Usage:
peloton-to-garmin.py [-h] [-email EMAIL] [-password PASSWORD] [-path OUTPUT_DIR] [-num NUM_TO_DOWNLOAD] [-log LOG_FILE]
optional arguments:
- -h, --help show this help message and exit
- -email EMAIL Peloton email address
- -password PASSWORD Peloton password
- -path OUTPUT_DIR Path to output directory
- -num NUM_TO_DOWNLOAD Number of activities to download
- -log LOG_FILE Log file name## Runnning in docker
- -loglevel LOGLEVEL DEBUG, INFO, ERROR
- -garmin_email Garmin email address for upload to Garmin
- -garmin_password Garmin password for upload to Garmin
Examples:
- To get the last 10 activities:
*peloton-to-garmin.py -num 10
- To pass your email and passowrd:
*peloton-to-garmin.py -email you@email.com -password mypassword
Note: Command line arguments take precedence over values in the configuration file.
If you want to use environment variables instead of command line arguements, use the following environment variables.
P2G_PELOTON_EMAIL
Peloton email addressP2G_PELOTON_PASS
Peloton passwordP2G_PATH
Path to output directoryP2G_NUM
Number of activities to downloadP2G_LOG
Log file name## Runnning in dockerP2G_LOG_LEVEL
DEBUG, INFO, ERRORP2G_GARMIN_EMAIL
Garmin email address for upload to GarminP2G_GARMIN_PASS
Garmin password for upload to Garmin
The matrix of supported Python versions and OS's can be found here.
Various config and upload history is maintained in a local database.json
file. Deleting this file will delete any upload history and the servic will attempt to upload all workouts to Garmin Connect again.
Special thanks to all the contributors who have helped improve this project!
Garmin Upload feature is provided by the library: https://github.com/La0/garmin-uploader