Ctrl+Shift+P > Open Folder in container
- Install any C# executable and add
dotnet/Dynastream.FIT.Portable.dll
dependency - Install
fit_creator
python package e.g. usingpip
withpip install .
Just shell-execute
run.sh
It does three steps:
- Download all available html workout pages from
whatsonzwift.com/workouts
and saves them indata/html/zwift
directory (somewhat time consuming - the internet is the bottleneck). - Scrapes relevant info from each download page and saves workouts in
.wkt
format indata/workouts/wkt
directory. (for all workouts, fast) - Converts workouts from Build Me Up plan from
data/workouts/wkt/Build_Me_Up
from.wkt
to.fit
format and saves them indata/workouts/fit
directory. This is veeeery time consuming. The work is done viadotnet run
and it's C# code executed there - that's why I do this only for one (my favourite) plan. You can just run the last python command inrun.sh
with your favourite plan in place of Build_Me_Up.
Time: (downloading excluded)
real 2m44.838s
user 2m59.810s
sys 0m11.321s
I wrote my own serialization decorator.
@serializable
@dataclass
class Workout:
name: str
steps: list[WorkoutStep | WorkoutStepRepeat]
created: datetime = datetime.now()
It solves the problem of flat deserializations performed by @dataclasses_json
and maybe other libraries, as they don't seem to keep any information about the origin class. Therefore one can infer if a particular item in steps
is WorkoutStep
or WorkoutStepRepeat
.
The decorator adds 4 methods serialize
, deserialize
, load
and save
to your dataclass object and is easily extensible to support other data types.