Initial version

This commit is contained in:
Ollo 2024-10-25 19:57:14 +00:00
commit 8680f22a6e
4 changed files with 40 additions and 0 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM python:3.9
# Or any preferred Python version.
ADD main.sh /root/
ADD convertAllFits.py /root/
ADD https://raw.githubusercontent.com/dodo-saba/fit2gpx/refs/heads/main/src/fit2gpx.py /root/
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir pandas gpxpy fitdecode
CMD ["/bin/sh", "/root/main.sh"]
# Or enter the name of your unique directory and parameter set.

9
Readme.md Normal file
View File

@ -0,0 +1,9 @@
# Sigma Rox 4 file converter
## Installation
docker build .
## Execution
docker run -v /tmp:/container/directory sha256:<last line of build script>

16
convertAllFits.py Normal file
View File

@ -0,0 +1,16 @@
from fit2gpx import Converter
from os import listdir
from os.path import isfile, join
mypath='/container/directory'
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
conv = Converter()
for f in onlyfiles:
if "activity_uncompleted" in f:
print(" Ignore" + f)
elif f.endswith(".fit"):
print(mypath+'/'+f)
gpx = conv.fit_to_gpx(f_in=mypath+'/'+f, f_out=mypath+'/'+f+'test.gpx')

6
main.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
echo "--------------- Files ------------"
ls -l /container/directory/*.fit
echo "---------- End files ------------"
cd /root/
python3 ./convertAllFits.py