vdotz 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vdotz-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
vdotz-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,233 @@
1
+ Metadata-Version: 2.4
2
+ Name: vdotz
3
+ Version: 0.1.0
4
+ Summary: Running pace and race-time tools.
5
+ Author: m09
6
+ Author-email: m09 <142691+m09@users.noreply.github.com>
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Requires-Dist: fit-tool>=0.9.16
10
+ Requires-Dist: garmin-fit-sdk>=21.221.0
11
+ Requires-Dist: niquests>=3.17.0
12
+ Requires-Dist: python-dotenv>=1.2.4
13
+ Requires-Python: >=3.13
14
+ Description-Content-Type: text/markdown
15
+
16
+ # `vdotz`
17
+
18
+ Running pace and race-time tools, built on Jack Daniels' VDOT, with workout
19
+ templates synced to intervals.icu.
20
+
21
+ ```sh
22
+ vdotz vdot 5km 19:10 # VDOT of a race and equivalent race times
23
+ vdotz paces # usual reference paces at the current VDOT
24
+ vdotz paces marathon "10km+3%" # any pace of the templates syntax
25
+ vdotz --vdot 48.3 paces "4:39*95%"
26
+ vdotz week # intervals / easy / rests of the current week
27
+ vdotz week -1 --type Ride # previous week, for another activity type
28
+ vdotz course race.gpx -D marathon marathon 3:05:00 # even-effort splits
29
+ vdotz fit strength/*.toml -o GARMIN/NewFiles # strength sessions for Garmin
30
+ vdotz watch # strength + non-easy plan workouts to the watch
31
+ ```
32
+
33
+ ## Installation
34
+
35
+ ```sh
36
+ uv tool install vdotz
37
+ ```
38
+
39
+ From a clone of the repository, to work on it:
40
+
41
+ ```sh
42
+ uv tool install --editable .
43
+ vdotz link # see below
44
+ ```
45
+
46
+ Files follow the XDG base directory specification:
47
+
48
+ ```
49
+ ~/.config/vdotz/ # $XDG_CONFIG_HOME/vdotz
50
+ ├── config.toml # athlete_id = "i…" and vdot = 52.3, or a [test] table
51
+ └── .env # INTERVALS_API_KEY=…
52
+ ~/.local/share/vdotz/ # $XDG_DATA_HOME/vdotz, or -d DIRECTORY
53
+ ├── 🏃 NSM/ # one subdirectory per intervals.icu library folder
54
+ │ └── intervalles-courts.toml
55
+ └── 🏃 NSM plan.toml # one file per intervals.icu plan
56
+ ```
57
+
58
+ They are versioned in this repository as `config/` (where `.env` is ignored by
59
+ git) and `workouts/`: `vdotz link` links the two locations to them, so that
60
+ `vdotz` works from any directory. `--vdot` overrides the configured VDOT.
61
+
62
+ ## Course paces
63
+
64
+ `vdotz course` reads a GPX track and prints the paces of an even effort over
65
+ the course: per kilometer (with the cumulative time and the waypoints, such as
66
+ feed stations), then over each climb and descent. Goals are flat paces in the
67
+ `paces` syntax (`marathon` by default, `4:20`, `semi+2%`), or finish times
68
+ (`3:05:00`). `-D` scales the track to the official distance, since GPS tracks
69
+ are rarely exact.
70
+
71
+ The track is resampled every 20 m and its elevation smoothed over 200 m, as raw
72
+ GPS elevations count much more climbing than there is. Each segment's pace is
73
+ the flat pace times `1 + 0.033·g` uphill, `1 + 0.018·max(g, -4)` downhill, for a
74
+ grade of `g`%. A waypoint near a road that the course takes twice gets both
75
+ passes.
76
+
77
+ ## Strength sessions
78
+
79
+ `vdotz fit` converts strength sessions (`strength/` in this repository) to
80
+ Garmin strength workouts, as FIT files. Copied to `GARMIN/NewFiles` on the
81
+ watch, they show up in its workouts.
82
+
83
+ ```toml
84
+ name = "Muscu mardi"
85
+ warmup = "5-10', puis séries de montée en charge" # open step, optional
86
+
87
+ [[blocks]]
88
+ sets = 3 # defaults to 1
89
+ rest = "3'" # after each set, optional
90
+ exercises = [
91
+ { exercise = "deadlift/barbell_deadlift", name = "Soulevé de terre", reps = 5, weight = 102 },
92
+ { exercise = "plank/side_plank", name = "Gainage latéral", duration = "30s", unilateral = true },
93
+ ]
94
+ ```
95
+
96
+ A block with several exercises is a superset. `exercise` is a category of the
97
+ FIT profile, optionally followed by an exercise of this category, in lower case
98
+ (see `ExerciseCategory` and the `…ExerciseName` enums of `fit_tool`). `name` is
99
+ the step name; `weight` is in kg.
100
+
101
+ An exercise with `unilateral = true` becomes two steps, left then right, each
102
+ with its `reps` or `duration`: a timed circuit then gives its full time to each
103
+ side. The side is at the start of the step notes. Timed sides are separated by
104
+ 5 s of rest, to change sides.
105
+
106
+ ## Garmin watch
107
+
108
+ `vdotz watch` copies to a Garmin watch plugged in over USB the strength
109
+ sessions and the workouts of the plans, except easy runs (`E …`), which are
110
+ just a time. The running workouts are converted to FIT by intervals.icu, from
111
+ the library: run `vdotz sync` first after changing a template (a warning
112
+ says so). Strength sessions are optional: without a `strength` directory next
113
+ to the workouts, only the running workouts are copied.
114
+
115
+ The watch is mounted over MTP once opened in the file manager: the files go to
116
+ `GARMIN/NewFiles`, found under `/run/user/$UID/gvfs`, and are imported when the
117
+ watch is unplugged. The previous versions, which the watch would keep beside
118
+ the new ones, are removed from `GARMIN/Workouts` first. `-o` gives another
119
+ directory.
120
+
121
+ ## Merging activities
122
+
123
+ `vdotz merge` merges the activities of a day into a single FIT file, ready to
124
+ be uploaded to Garmin Connect, for a run split by stopping the watch by mistake.
125
+ It downloads the original files from intervals.icu, and the time between two
126
+ activities becomes a timer pause.
127
+
128
+ ```sh
129
+ vdotz merge # today's runs
130
+ vdotz merge 2026-11-05 -t Ride -o ride.fit # another day and activity type
131
+ vdotz merge 2026-11-05 -a i123 -a i456 # only these activities
132
+ ```
133
+
134
+ It lists the activities it finds: if the merged file already came back to
135
+ intervals.icu, they overlap, and `-a` chooses the originals. Records are kept as
136
+ they are, and the session is computed from those of the activities, with a few
137
+ approximations: the normalized power is a mean, the training effects are the
138
+ highest ones, and the feel and RPE are those of the last activity. Garmin splits
139
+ are dropped. See `merge.py` for the details.
140
+
141
+ Delete the originals afterwards, on Garmin Connect and on intervals.icu, or the
142
+ load of the day is counted twice.
143
+
144
+ ## Elevation correction
145
+
146
+ intervals.icu can replace the altitude recorded by the watch with the one of
147
+ online maps. On flat routes this adds climbing that doesn't exist: 154 m instead
148
+ of 9 m around the Île de Nantes. It also changes the training load, which follows
149
+ the pace load.
150
+
151
+ `vdotz elevation` turns the correction off on recent activities, and prints
152
+ their elevation gain before and after. The gain is recalculated straight away.
153
+ Activities already corrected are left alone, so it can be run at any time.
154
+
155
+ ```sh
156
+ vdotz elevation --dry-run # list the runs of the last 30 days
157
+ vdotz elevation # turn the correction off
158
+ vdotz elevation --days 90 -t Ride # another period and activity type
159
+ ```
160
+
161
+ ## Workout templates
162
+
163
+ `vdotz` keeps intervals.icu workouts as local files whose paces are derived
164
+ from a VDOT, and pushes them to intervals.icu on demand (e.g. after a test).
165
+
166
+ ```toml
167
+ # config.toml
168
+ athlete_id = "i364734"
169
+
170
+ [test]
171
+ distance = "5km"
172
+ time = "19:10"
173
+ ```
174
+
175
+ ```toml
176
+ # 🏃 NSM/intervalles-courts.toml
177
+ name = "Intervalles courts"
178
+ type = "Run"
179
+ description = '''
180
+ 11x
181
+ - 3' {60'+1%}-{60'} Pace intensity=interval
182
+ - 1' intensity=rest
183
+ '''
184
+ ```
185
+
186
+ Descriptions use the intervals.icu workout builder syntax. Placeholders between
187
+ braces are replaced by the maximal pace over a duration (`{1h}`, `{90'}`) or a
188
+ distance (`{10km}`, `{semi}`, `{marathon}`), by the pace at VO2max (`{mas}`), or
189
+ by a literal pace (`{4:39}`). Adjustments apply from left to right: `*65%` for
190
+ 65% of the speed, `+1%` for a pace 1% slower, `+2'` for a pace 2 min/km slower
191
+ (e.g. `{mas*65%+2'}`). Each placeholder is a single pace: ranges join two
192
+ placeholders (e.g. `{60'+1%}-{60'}`).
193
+
194
+ `vdotz week` classifies the planned steps by intensity: `interval` steps are
195
+ intervals, `rest` steps are rests, and everything else is easy running.
196
+
197
+ The API key is read from the `INTERVALS_API_KEY` environment variable, or from a
198
+ `.env` file in the current directory, one of its parents, or the configuration
199
+ directory.
200
+
201
+ ```sh
202
+ vdotz pull "🏃 NSM" # bootstrap from an existing folder
203
+ vdotz render # preview the computed paces
204
+ vdotz sync --dry-run # show the diff with intervals.icu
205
+ vdotz sync --calendar # update the library and planned workouts
206
+ ```
207
+
208
+ ## Plans
209
+
210
+ A TOML file at the root of the workouts directory is an intervals.icu plan, named
211
+ after the file. It lists workouts week by week, from Monday to Sunday, with `""`
212
+ for rest days. Workouts can come from any folder, as long as their names are
213
+ unique:
214
+
215
+ ```toml
216
+ # 🏃 NSM plan.toml
217
+ weeks = [
218
+ ["Jog", "Intervalles courts", "", "Intervalles moyens", "", "Jog", "Sortie longue"],
219
+ ]
220
+ ```
221
+
222
+ `vdotz sync` creates the plan and keeps its workouts identical to the
223
+ templates, matched by day: plan workouts on rest days are deleted. Plans are
224
+ applied to the calendar from intervals.icu, after which `sync --calendar` keeps
225
+ the planned workouts up to date.
226
+
227
+ ## Releasing
228
+
229
+ 1. `uv run bumpver update --minor` (or `--patch`, `--major`): bumps, commits, tags
230
+ and pushes.
231
+ 2. `uv run doit publish`: builds and uploads to PyPI with the token of
232
+ `creds.env`, a gitignored file at the repository's root holding one line,
233
+ `export UV_PUBLISH_TOKEN=pypi-...`, readable by you only (`chmod 400`).
vdotz-0.1.0/README.md ADDED
@@ -0,0 +1,218 @@
1
+ # `vdotz`
2
+
3
+ Running pace and race-time tools, built on Jack Daniels' VDOT, with workout
4
+ templates synced to intervals.icu.
5
+
6
+ ```sh
7
+ vdotz vdot 5km 19:10 # VDOT of a race and equivalent race times
8
+ vdotz paces # usual reference paces at the current VDOT
9
+ vdotz paces marathon "10km+3%" # any pace of the templates syntax
10
+ vdotz --vdot 48.3 paces "4:39*95%"
11
+ vdotz week # intervals / easy / rests of the current week
12
+ vdotz week -1 --type Ride # previous week, for another activity type
13
+ vdotz course race.gpx -D marathon marathon 3:05:00 # even-effort splits
14
+ vdotz fit strength/*.toml -o GARMIN/NewFiles # strength sessions for Garmin
15
+ vdotz watch # strength + non-easy plan workouts to the watch
16
+ ```
17
+
18
+ ## Installation
19
+
20
+ ```sh
21
+ uv tool install vdotz
22
+ ```
23
+
24
+ From a clone of the repository, to work on it:
25
+
26
+ ```sh
27
+ uv tool install --editable .
28
+ vdotz link # see below
29
+ ```
30
+
31
+ Files follow the XDG base directory specification:
32
+
33
+ ```
34
+ ~/.config/vdotz/ # $XDG_CONFIG_HOME/vdotz
35
+ ├── config.toml # athlete_id = "i…" and vdot = 52.3, or a [test] table
36
+ └── .env # INTERVALS_API_KEY=…
37
+ ~/.local/share/vdotz/ # $XDG_DATA_HOME/vdotz, or -d DIRECTORY
38
+ ├── 🏃 NSM/ # one subdirectory per intervals.icu library folder
39
+ │ └── intervalles-courts.toml
40
+ └── 🏃 NSM plan.toml # one file per intervals.icu plan
41
+ ```
42
+
43
+ They are versioned in this repository as `config/` (where `.env` is ignored by
44
+ git) and `workouts/`: `vdotz link` links the two locations to them, so that
45
+ `vdotz` works from any directory. `--vdot` overrides the configured VDOT.
46
+
47
+ ## Course paces
48
+
49
+ `vdotz course` reads a GPX track and prints the paces of an even effort over
50
+ the course: per kilometer (with the cumulative time and the waypoints, such as
51
+ feed stations), then over each climb and descent. Goals are flat paces in the
52
+ `paces` syntax (`marathon` by default, `4:20`, `semi+2%`), or finish times
53
+ (`3:05:00`). `-D` scales the track to the official distance, since GPS tracks
54
+ are rarely exact.
55
+
56
+ The track is resampled every 20 m and its elevation smoothed over 200 m, as raw
57
+ GPS elevations count much more climbing than there is. Each segment's pace is
58
+ the flat pace times `1 + 0.033·g` uphill, `1 + 0.018·max(g, -4)` downhill, for a
59
+ grade of `g`%. A waypoint near a road that the course takes twice gets both
60
+ passes.
61
+
62
+ ## Strength sessions
63
+
64
+ `vdotz fit` converts strength sessions (`strength/` in this repository) to
65
+ Garmin strength workouts, as FIT files. Copied to `GARMIN/NewFiles` on the
66
+ watch, they show up in its workouts.
67
+
68
+ ```toml
69
+ name = "Muscu mardi"
70
+ warmup = "5-10', puis séries de montée en charge" # open step, optional
71
+
72
+ [[blocks]]
73
+ sets = 3 # defaults to 1
74
+ rest = "3'" # after each set, optional
75
+ exercises = [
76
+ { exercise = "deadlift/barbell_deadlift", name = "Soulevé de terre", reps = 5, weight = 102 },
77
+ { exercise = "plank/side_plank", name = "Gainage latéral", duration = "30s", unilateral = true },
78
+ ]
79
+ ```
80
+
81
+ A block with several exercises is a superset. `exercise` is a category of the
82
+ FIT profile, optionally followed by an exercise of this category, in lower case
83
+ (see `ExerciseCategory` and the `…ExerciseName` enums of `fit_tool`). `name` is
84
+ the step name; `weight` is in kg.
85
+
86
+ An exercise with `unilateral = true` becomes two steps, left then right, each
87
+ with its `reps` or `duration`: a timed circuit then gives its full time to each
88
+ side. The side is at the start of the step notes. Timed sides are separated by
89
+ 5 s of rest, to change sides.
90
+
91
+ ## Garmin watch
92
+
93
+ `vdotz watch` copies to a Garmin watch plugged in over USB the strength
94
+ sessions and the workouts of the plans, except easy runs (`E …`), which are
95
+ just a time. The running workouts are converted to FIT by intervals.icu, from
96
+ the library: run `vdotz sync` first after changing a template (a warning
97
+ says so). Strength sessions are optional: without a `strength` directory next
98
+ to the workouts, only the running workouts are copied.
99
+
100
+ The watch is mounted over MTP once opened in the file manager: the files go to
101
+ `GARMIN/NewFiles`, found under `/run/user/$UID/gvfs`, and are imported when the
102
+ watch is unplugged. The previous versions, which the watch would keep beside
103
+ the new ones, are removed from `GARMIN/Workouts` first. `-o` gives another
104
+ directory.
105
+
106
+ ## Merging activities
107
+
108
+ `vdotz merge` merges the activities of a day into a single FIT file, ready to
109
+ be uploaded to Garmin Connect, for a run split by stopping the watch by mistake.
110
+ It downloads the original files from intervals.icu, and the time between two
111
+ activities becomes a timer pause.
112
+
113
+ ```sh
114
+ vdotz merge # today's runs
115
+ vdotz merge 2026-11-05 -t Ride -o ride.fit # another day and activity type
116
+ vdotz merge 2026-11-05 -a i123 -a i456 # only these activities
117
+ ```
118
+
119
+ It lists the activities it finds: if the merged file already came back to
120
+ intervals.icu, they overlap, and `-a` chooses the originals. Records are kept as
121
+ they are, and the session is computed from those of the activities, with a few
122
+ approximations: the normalized power is a mean, the training effects are the
123
+ highest ones, and the feel and RPE are those of the last activity. Garmin splits
124
+ are dropped. See `merge.py` for the details.
125
+
126
+ Delete the originals afterwards, on Garmin Connect and on intervals.icu, or the
127
+ load of the day is counted twice.
128
+
129
+ ## Elevation correction
130
+
131
+ intervals.icu can replace the altitude recorded by the watch with the one of
132
+ online maps. On flat routes this adds climbing that doesn't exist: 154 m instead
133
+ of 9 m around the Île de Nantes. It also changes the training load, which follows
134
+ the pace load.
135
+
136
+ `vdotz elevation` turns the correction off on recent activities, and prints
137
+ their elevation gain before and after. The gain is recalculated straight away.
138
+ Activities already corrected are left alone, so it can be run at any time.
139
+
140
+ ```sh
141
+ vdotz elevation --dry-run # list the runs of the last 30 days
142
+ vdotz elevation # turn the correction off
143
+ vdotz elevation --days 90 -t Ride # another period and activity type
144
+ ```
145
+
146
+ ## Workout templates
147
+
148
+ `vdotz` keeps intervals.icu workouts as local files whose paces are derived
149
+ from a VDOT, and pushes them to intervals.icu on demand (e.g. after a test).
150
+
151
+ ```toml
152
+ # config.toml
153
+ athlete_id = "i364734"
154
+
155
+ [test]
156
+ distance = "5km"
157
+ time = "19:10"
158
+ ```
159
+
160
+ ```toml
161
+ # 🏃 NSM/intervalles-courts.toml
162
+ name = "Intervalles courts"
163
+ type = "Run"
164
+ description = '''
165
+ 11x
166
+ - 3' {60'+1%}-{60'} Pace intensity=interval
167
+ - 1' intensity=rest
168
+ '''
169
+ ```
170
+
171
+ Descriptions use the intervals.icu workout builder syntax. Placeholders between
172
+ braces are replaced by the maximal pace over a duration (`{1h}`, `{90'}`) or a
173
+ distance (`{10km}`, `{semi}`, `{marathon}`), by the pace at VO2max (`{mas}`), or
174
+ by a literal pace (`{4:39}`). Adjustments apply from left to right: `*65%` for
175
+ 65% of the speed, `+1%` for a pace 1% slower, `+2'` for a pace 2 min/km slower
176
+ (e.g. `{mas*65%+2'}`). Each placeholder is a single pace: ranges join two
177
+ placeholders (e.g. `{60'+1%}-{60'}`).
178
+
179
+ `vdotz week` classifies the planned steps by intensity: `interval` steps are
180
+ intervals, `rest` steps are rests, and everything else is easy running.
181
+
182
+ The API key is read from the `INTERVALS_API_KEY` environment variable, or from a
183
+ `.env` file in the current directory, one of its parents, or the configuration
184
+ directory.
185
+
186
+ ```sh
187
+ vdotz pull "🏃 NSM" # bootstrap from an existing folder
188
+ vdotz render # preview the computed paces
189
+ vdotz sync --dry-run # show the diff with intervals.icu
190
+ vdotz sync --calendar # update the library and planned workouts
191
+ ```
192
+
193
+ ## Plans
194
+
195
+ A TOML file at the root of the workouts directory is an intervals.icu plan, named
196
+ after the file. It lists workouts week by week, from Monday to Sunday, with `""`
197
+ for rest days. Workouts can come from any folder, as long as their names are
198
+ unique:
199
+
200
+ ```toml
201
+ # 🏃 NSM plan.toml
202
+ weeks = [
203
+ ["Jog", "Intervalles courts", "", "Intervalles moyens", "", "Jog", "Sortie longue"],
204
+ ]
205
+ ```
206
+
207
+ `vdotz sync` creates the plan and keeps its workouts identical to the
208
+ templates, matched by day: plan workouts on rest days are deleted. Plans are
209
+ applied to the calendar from intervals.icu, after which `sync --calendar` keeps
210
+ the planned workouts up to date.
211
+
212
+ ## Releasing
213
+
214
+ 1. `uv run bumpver update --minor` (or `--patch`, `--major`): bumps, commits, tags
215
+ and pushes.
216
+ 2. `uv run doit publish`: builds and uploads to PyPI with the token of
217
+ `creds.env`, a gitignored file at the repository's root holding one line,
218
+ `export UV_PUBLISH_TOKEN=pypi-...`, readable by you only (`chmod 400`).