pe-st / garmin-connect-export

Download a copy of your Garmin Connect data, including stats and GPX tracks.
MIT License
364 stars 75 forks source link

Implementing Feature Request #28: workflowdirectory #32

Closed telemaxx closed 3 years ago

telemaxx commented 4 years ago

Implementing: https://github.com/pe-st/garmin-connect-export/issues/28

News:

telemaxx commented 4 years ago

Tests done: ---Windows:-- P3: fitfiles with unzip c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 10 -f original --username "myname" --password "mypasswd" --directory "C:\public\gps" --unzip

P3: gpx files c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 5 -f gpx --username "myname" --password "mypasswd" --directory "C:\public\gps"

P3: tcx files c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 5 -f tcx --username "myname" --password "mypasswd" --directory "C:\public\gps"

P3: gpx files in subfolder c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 5 -f gpx --username "myname" --password "mypasswd" --directory "C:\public\gps" -s gpx

P3: tcx files in subfolder c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 5 -f tcx --username "myname" --password "mypasswd" --directory "C:\public\gps" -s tcx

P3: some more advanced parameter c:\Python3\Python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 12 -f tcx --username "myname" --password "mypasswd"--directory "C:\public\gps" --unzip --desc 12 -fp -sa 8 -s tcx

P3: fit files in workflowmode with naming options c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 10 -f original --username "myname" --password "mypasswd" --directory "C:\public\gps" --workflowdirectory c:\public --unzip --wdesc 10 --wdevice 5

P3: all fit files in workflowmode with naming options c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c all -f original --username "myname" --password "mypasswd" --directory "C:\public\gps" --workflowdirectory c:\public --unzip --wdesc 10 --wdevice 5

P3: fit files in workflowmode with queering username and password c:\Python3\python.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c all -f original --directory "C:\public\gps" --workflowdirectory c:\public --unzip

P2: fitfiles with unzip c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 10 -f original --username "myname" --password "mypasswd" --directory "C:\public\gps" --unzip

P2: gpx files c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 10 -f gpx --username "myname" --password "mypasswd" --directory "C:\public\gps"

P2: tcx files with some options c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 10 -f tcx --username "myname" --password "mypasswd" --directory "C:\public\gps" --unzip --desc 12 -fp -sa 8 -s tcx

P2: gpx files in subfolder c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 5 -f gpx --username "myname" --password "mypasswd" --directory "C:\public\gps" -s gpx

P2: tcx files in subfolder c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 5 -f tcx --username "myname" --password "mypasswd" --directory "C:\public\gps" -s tcx

P2: tcx file in subfolder with many options c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 12 -f tcx --username "myname" --password "mypasswd"--directory "C:\public\gps" --unzip --desc 12 -fp -sa 8 -s tcx

P2: fitfiles with unzip in workflowmode with naming options c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c 10 -f original --username "myname" --password "mypasswd" --directory "C:\public\gps" --workflowdirectory c:\public --unzip --wdesc 10 --wdevice 5

P2: all fitfiles with unzip in workflowmode with naming options c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c all -f original --username "myname" --password "mypasswd" --directory "C:\public\gps" --workflowdirectory c:\public --unzip --wdesc 10 --wdevice 5

P2: fit files in workflowmode with queering username and password c:\Pypy2\pypy.exe C:\Users\top\BTSync\SA5\qpython\scripts\Garmin-Connect-Export-pest\gcexport.py -c all -f original --directory "C:\public\gps" --workflowdirectory c:\public --unzip

-- Linux -- Python 3 /usr/bin/python3 $garmin_base_dir/gcexport.py -c 5 -f original -v --username $garmin_user --password $garmin_pw --directory $garmin_fit_dir --workflowdirectory $garmin_mytourbook_fit_dir --unzip --wdesc 25 --wdevice 8

telemaxx commented 4 years ago

Summary Output:

....
Garmin Connect activity (25\27) [4634752569] Barsinghausen Mountainbiken
        2020-03-01T13:02:26+01:00, 05:08:57, 42.796km
        FIT data file already exists; skipping...
Garmin Connect activity (26\27) [4607008214] Hannover Rennradfahren
        2020-03-01T11:23:20+01:00, 00:56:14, 8.827km
Garmin Connect activity (27\27) [4603830247] Krafttraining
        2020-02-29T16:11:30+01:00, 00:11:55, 0.000km
Total Requested..........27
Total Downloaded.........2
Total Copied(workflow)...0
Total Skipped............25
Done!
pe-st commented 4 years ago
> Total Requested..........27
> Total Downloaded.........2
> Total Copied(workflow)...0
> Total Skipped............25
> Done!

I like this summary 😄

pe-st commented 4 years ago
* new parameters  `--wdesc`  `--wdevice` for naming workflow files

To avoid too many options just dealing with the file name (there are already --desc and --fileprefix) I would like to take a different approach with some kind of format string, e.g. an option -nt <tmpl>/--nametemplate <tmpl> where <tmpl> is a simple format string inspired by Pythons format() function.

If you want a different filename for the workflow (would that be needed?), an option -wnt <tmpl>/--wnametemplate <tmpl> could be defined using the same algorithm.

Possible examples (untested)

What do you think?

telemaxx commented 4 years ago

If you want a different filename for the workflow (would that be needed?), an option -wnt <tmpl>/--wnametemplate <tmpl> could be defined using the same algorithm.

this is a good idea. yesterday i thought, would be nice having also the recording length kilometers inside the filename... with templates it would be flexible and without many new options.

If possible, i would like to have workflow filenames without that cryptic activity id. maybe with -wnt <tmpl> option or just -nt <tmpl> when we suppress the activity id for workflow filenames. for the "normal" files, i think, we need the id to detect if activities are already downloaded. or?

we could start with just -nt <tmpl> but it could be complicate to implement. did you have a plan how to do this?

telemaxx commented 3 years ago

updating my fork and send a new PR