workout-note-parser

Crates.ioworkout-note-parser
lib.rsworkout-note-parser
version0.1.1
sourcesrc
created_at2023-11-12 15:48:10.712531
updated_at2023-11-12 15:51:59.940559
descriptionParse workout notes into JSON format.
homepage
repositoryhttps://github.com/jazzandrock/workout-note-parser
max_upload_size
id1032827
size28,437
Oleg (jazzandrock)

documentation

README

Workout note parser

Ever wanted to parse your workout data from a file? Well, now you can! Take a look at this example workout note:

Name of the first exercise
20 x 10 This is a comment. There you write 
30 x 10 how you felt during the exercise,
40 x 10 like "this was close to the edge"
50 x 10 or "this was easy, better increase the weight".
60 x 10 The first number is the weight, the second is the number of reps.
70 x 10 + 40 x 6 Sometimes you do all you can with one weight and then 
80 x 10 immediately you take a smaller weight and do a few more reps. 
90 x 10 You can write it as well

bench press
20 x 10
50 x 10
60 x 10 near death experience
70 x 5 + 40 x 10   

Now you can parse it down to a neat data structure:

struct Set {
    weight: f32,
    n_reps: i32,
}

struct Exercise {
    name: String,
    sets: Vec<Set>,
    comment: Option<String>,
}

Usage

Use the command this way:

cargo install workout-note-parser

workout-note-parser -i - < input.txt > output.txt
workout-note-parser -i input.txt > output.txt
workout-note-parser -i input.txt -o output.txt

You can then use the output (in JSON format) to plot your progress, for example, with ChatGPT data analysis tool. Or just write a plotter yourself.

License

MIT license

Commit count: 12

cargo fmt