Warning: long, possibly boring programming post approaching. Not like, "programming", but
programming. Specifically Python.
I've been meaning to make a program to convert my lifts for a while. I lift in all kg now, but want to continue logging in lb. I do love the little converter that pops up when you highlight numbers here (that was
@unruhschuh, right?), but I don't feel like doing that for every set, especially when I'm doing ascending weights, and have to do it five times for one lift.
Well, I've finally gotten around to that. It's not totally finished (e.g., doesn't handle belted vs beltless yet), but it's enough to save me some time. As importantly, it lets me write in Notion in more normal, non-table-formatted form, like this (the extra spaces are insert by Notion, another annoyance this saves me from):
Monday, 6 December
Session RPE - 8.5
Session Time - 3:05
Broad Jump
3*8 - 30', 32', 32', 32', 30', 32', 32.5', 31'
Power Snatch
90*2@8
92*2@8
94*2*2@10, 8
96*2@10
LB Squat
210*1@9.5, wow
170*5@7
155*5*2@6, 5
T&G Bench
105*8*4@8-8.5
Curl-Grip Barbell Row
20*5@5
30*5*1@7, 8, 9.5
and converts it to this:
Code: Select all
[URL=link]Monday[/URL], 6 December
[table]
[tr][td][b]Session RPE/Time[/b][/td][td][b]8.5/3:05[/b][/td][/tr]
[tr][td][i][u][b]Exercise[/b][/u][/i][/td][td][i][u][b]Weight*Reps*Sets@RPE[/b][/u][/i][/td][/tr]
[tr][td]Broad Jump[/td][td]
7*8 - 30', 32', 32', 32', 30', 32', 32.5', 31'
[tr][td]Power Snatch[/td][td]
198*2@8
203*2@8
207*2*2@10, 8
212*2@10
[tr][td]LB Squat[/td][td]
463*1@9.5, wow
375*5@7
342*5*2@6, 5
[tr][td]T&G Bench[/td][td]
231*8*4@8-8.5
[tr][td]Curl-Grip Barbell Row[/td][td]
44*5@5
66*5*1@7, 8, 9.5
[/td][/tr]
[/table]
Which then shows up as this:
Monday, 6 December
Session RPE/Time | 8.5/3:05 |
Exercise | Weight*Reps*Sets@RPE |
Broad Jump |
7*8 - 30', 32', 32', 32', 30', 32', 32.5', 31' |
Power Snatch |
198*2@8
203*2@8
207*2*2@10, 8
212*2@10 |
LB Squat |
463*1@9.5, wow
375*5@7
342*5*2@6, 5 |
T&G Bench |
231*8*4@8-8.5 |
Curl-Grip Barbell Row |
44*5@5
66*5*1@7, 8, 9.5
|
Another issue is that I don't currently have it set to be specific about what it converts, hence why "3" in broad jumps gets turned into "7".
I'm currently looking at the first character of each line and checking if it's numeric (if char.isnumeric():), and I feel like I should be able to add ( and int(char) > 10) to ignore any numbers under 10, but that's giving me a weird error later. I'll figure it out as I move forward. This is about as much for getting back into programming as it is for my own logging convenience.
Anyway, that's what I've been doing non-lifting wise.