commit 8680f22a6e70fe33e72c07951fda89ce974e012e Author: Ollo Date: Fri Oct 25 19:57:14 2024 +0000 Initial version diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..29acbad --- /dev/null +++ b/Dockerfile @@ -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. diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..880f0e7 --- /dev/null +++ b/Readme.md @@ -0,0 +1,9 @@ +# Sigma Rox 4 file converter + +## Installation + +docker build . + +## Execution + +docker run -v /tmp:/container/directory sha256: diff --git a/convertAllFits.py b/convertAllFits.py new file mode 100644 index 0000000..19a1816 --- /dev/null +++ b/convertAllFits.py @@ -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') diff --git a/main.sh b/main.sh new file mode 100644 index 0000000..f09d128 --- /dev/null +++ b/main.sh @@ -0,0 +1,6 @@ +#!/bin/bash +echo "--------------- Files ------------" +ls -l /container/directory/*.fit +echo "---------- End files ------------" +cd /root/ +python3 ./convertAllFits.py