From 8680f22a6e70fe33e72c07951fda89ce974e012e Mon Sep 17 00:00:00 2001 From: Ollo Date: Fri, 25 Oct 2024 19:57:14 +0000 Subject: [PATCH] Initial version --- Dockerfile | 9 +++++++++ Readme.md | 9 +++++++++ convertAllFits.py | 16 ++++++++++++++++ main.sh | 6 ++++++ 4 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 Readme.md create mode 100644 convertAllFits.py create mode 100644 main.sh 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