-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkout.py
executable file
·76 lines (70 loc) · 2.91 KB
/
workout.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import random
def warmup(vweek, day, warmups, outputs):
outputs["week" + vweek]["day" + day].append(
" Warmup: {0}".format(random.choice(warmups[day]))
)
return outputs
def mainliftwrite(vweek, day, percentages, msq, mbe, mdl,
mainliftchoice, outputs):
percentage = percentages[mainliftchoice]["week" + vweek]["percent"]
reprange = percentages[mainliftchoice]["week" + vweek]["reprange"]
if day == '1':
outputs["week" + vweek]["day" + day].append(
" Squat: {0}lbs {1}".format(
(int(5 * round((msq * percentage) / 5))), reprange))
if day == '2':
outputs["week" + vweek]["day" + day].append(
" Press: {0}lbs {1}".format(
(int(5 * round((mbe * percentage) / 5))), reprange))
outputs["week" + vweek]["day" + day].append(
" Curls: {0}lbs 3x8".format(
(int(5 * round((mbe * .4) / 5)))))
if day == '3':
outputs["week" + vweek]["day" + day].append(
" Deadlift: {0}lbs {1}".format(
(int(5 * round((mdl * percentage) / 5))), reprange))
outputs["week" + vweek]["day" + day].append(
" Bent Over Row: {0}lbs 3x5".format(
(int(5 * round((mdl * .4) / 5)))))
return outputs
def workoutscript(msq, mbe, mdl, mainliftchoice):
print("Called with msq:{} mbe:{} mdl:{} mainliftchoice:{}".format(
msq, mbe, mdl, mainliftchoice))
warmups = {
"1": ["Barbell Overhead Squat x 30",
"Goblet Squat x 30", "Lunges x 30"],
"2": ["50 LB KB Press x 15(each arm)",
"Pushups x 30", "Barbell Overhead x 30"],
"3": ["2H KB Swing x 30", "Barbell Front Squat x 30",
"Goblet Squat x 30", "Kettlebell DL x30"]
}
percentages = {
"high": {
"week1": {"percent": .55, "reprange": "5x10"},
"week2": {"percent": .6, "reprange": "5x9"},
"week3": {"percent": .65, "reprange": "5x8"},
"week4": {"percent": .7, "reprange": "5x7"},
"week5": {"percent": .75, "reprange": "5x6"}
},
"low": {
"week1": {"percent": .65, "reprange": "4x6"},
"week2": {"percent": .7, "reprange": "4x5"},
"week3": {"percent": .75, "reprange": "4x4"},
"week4": {"percent": .8, "reprange": "4x3"},
"week5": {"percent": .85, "reprange": "4x2"}
}
}
outputs = {}
try:
for vweek in range(5):
vweek = str(vweek + 1)
outputs["week" + vweek] = {}
for day in range(3):
day = str(day + 1)
outputs["week" + vweek]["day" + day] = []
warmup(vweek, day, warmups, outputs)
mainliftwrite(vweek, day, percentages, msq, mbe, mdl,
mainliftchoice, outputs)
return outputs
except ValueError:
pass