项目作者: mgifos

项目描述 :
Defines and schedules Garmin workouts
高级语言: Scala
项目地址: git://github.com/mgifos/quick-plan.git
创建时间: 2018-03-04T21:31:12Z
项目社区:https://github.com/mgifos/quick-plan

开源协议:Apache License 2.0

下载


Quick plan

is a command line tool to define, import, schedule and share GarminConnect workouts i.e. weekly based training plans.

An example of a workout definition notation:

  1. running: 15k, 3x3.2k @HMP
  2. - warmup: 2km @z2
  3. - repeat: 3
  4. - run: 3200m @ 5:05-4:50
  5. - recover: 800m @z2
  6. - run: 1km @z2
  7. - cooldown: lap-button

and the tool’s job is actually to translate it to this:
15k workout

File format

The file format is a spreadsheet exported to csv format. The 1st row is reserved for heading, can be anything (you define your first day of a week etc.). The 1st column is reserved for a week number. The cells represent days and they are populated with workouts (definitions and references), so there’s a limitation: a single workout per day/cell, for now. In case of the references, a workout needs to be defined first in one of the previous cells and then it can be referenced by name in the following cells.

An example of 2-weeks training plan, containing 2 workout definitions, 4 references and 6 training days in total:

Week Mon Tue Wed Thu Fri Sat Sun
1 running: run-fast
- warmup: 10:00 @ z2
- repeat: 3
- run: 1.5km @ 5:10-4:40
- recover: 500m @ z2
- cooldown: 05:00
rest rest run-fast rest rest rest
2 run-fast cycling: cycle-wo
- bike: 15 km @ 20.0-30kph
rest run-fast rest rest cycle-wo

Checkout a complete training plan for 80K ultra. It was originally published in an article on Runner’s world website - here’s the link.

Installation

  • Java 8 is a prerequisite, make sure you have it installed
  • Go to the releases page of this project
  • Download latest release zip file and unzip it somewhere on your computer
  • Enter bin folder and run quick-plan command (use quick-plan.bat if you are a Windows user or mark quick-plan script as executable on Linux or Mac systems)

Command line options

  1. quick-plan --help
  2. quick-plan 0.x
  3. Usage: quick-plan [import|schedule] [options] <file>
  4. -e, --email <value> E-mail to login to Garmin Connect
  5. -p, --password <value> Password to login to Garmin Connect
  6. -m, --measurement_system <value>
  7. "metric" (default) or "imperial" (miles, inches, ...) measurement system choice.
  8. -x, --delete Delete all existing workouts with same names as the ones that are going to be imported.
  9. -c, --auto-cooldown Add automatically cooldown: lap-button as an additional last step of each workout definition.
  10. --help prints this usage text
  11. <file> File with a weekly based plan in CSV format
  12. Command: import
  13. Imports all workout definitions from CSV file.
  14. Command: schedule [options]
  15. Schedules your weekly plan defined in CSV in Garmin Connect calendar, starting from the first day of first week or ending on the last day of the last week. Either start or end date must be entered so the scheduling can be done properly. In case both are entered, start date has priority. All dates have to be entered in ISO date format e.g. '2018-03-24'.
  16. -s, --start <value> Date of the first day of the first week of the plan
  17. -n, --end <value> Date of the last day of the last week of the plan
  18. EXAMPLES
  19. #Imports all the workouts from ultra 80k plan
  20. quick-plan import -e your-mail-address@example.com ultra-80k-runnersworld.csv
  21. #Deletes all the workouts from ultra 80k plan
  22. quick-plan -x your-mail-address@example.com ultra-80k-runnersworld.csv
  23. #Schedules ultra 80k plan targeting 28-4-2018 for a race day, while previously deleting if any with the same name already exists
  24. quick-plan schedule -n 2018-04-29 -x -e your-mail-address@example.com ultra-80k-runnersworld.csv

Workout notation

The reserved keywords of the notation are: workout, warmup, cooldown, run, bike, go, repeat, recover and lap-button.

<workout> := <header>(<newline><step>)+

<header> := [running | cycling | custom]: <name>

<name> := [\u0020-\u007F]+ (printable ascii characters)

<step> := <indent>- <step-def>

<step-def> := <simple-step> | <repetition-step>

<simple-step> := (warmup | cooldown | run | bike | go | recover): <duration> [@ <target>]

<repetition-step> := repeat: <count>(<newline><step>)+ (with each r. step, depth is increased by 1 - check <indent>)

<duration> := <distance-duration> | <time-duration> | lap-button

<distance-duration> := <number> (km | m | mi)

<time-duration> := <minutes>:<seconds>

<target> := <zone-target> | <pace-target> | <hr-target> | <speed-target> | <power-target> | <cadence-target>

<zone-target> := z[1-6]

<pace-target> := <pace> - <pace> (mpk | mpm)?

<hr-target> := \d{1,3} - \d{1,3} bpm

<power-target> := \d{1,3} - \d{1,3} W

<cadence-target> := \d{1,3} - \d{1,3} rpm

<speed-target> := <kph-speed> - <kph-speed> (kph | mph)?

<pace> := <minutes>:<seconds>

<kph-speed> := \d{1,3}(\.\d)?

<minutes> := \d{1,3}

<seconds> := \d{2}

<newline> := [\r\n]

<indent> := \s{depth * 2} (depends on depth parameter related to the repetion step / starts from 0)

Unit of measurements (metric vs imperial)

As Garmin supports metric and imperial measurement systems, quick-plan can do this as well. There are two ways of usage:

  • implicit (through the tool configuration (see the option -m) or
  • explicit (it can be specified within the workout definition by using units:
    • km vs mi (for distance),
    • kph vs mph (for speed) and
    • mpk vs mpm (for pace).

If not specified -m value from configuration will be used (‘metric’ by default).

Known issues

  • It is highly recommended to use Google Spreadsheets or LibreOffice Calc to edit CSV files, as they both force line-feed (LF)
    instead of carriage-return (CR) character for internal line breaks when defining workouts.
    The parser we use is not able to parse CR values within the quoted values at the moment.