Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yoga #5

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0a868b4
Update exercise.py
Marto32 May 28, 2022
d1ee5ca
Update routine.py
Marto32 May 28, 2022
3b5c1c1
Update workout.py
Marto32 May 28, 2022
b0c4933
Update workout_program.py
Marto32 May 28, 2022
0fa9680
Update runner.py
Marto32 May 28, 2022
180f568
Update workout_program.py
Marto32 May 28, 2022
da35910
Update workout.py
Marto32 May 28, 2022
1ca61e8
Update workout_program.py
Marto32 May 28, 2022
67235af
Add new workouts
May 31, 2022
d0cf2d8
Merge pull request #1 from Marto32/mm/conditioning
Marto32 May 31, 2022
fee14b1
Add option for all exercises in routine
May 31, 2022
184428b
Merge pull request #2 from Marto32/mm/routineupdate
Marto32 May 31, 2022
6338dc3
Update routine.py
Marto32 May 31, 2022
9f98040
Update exercise.py
Marto32 Jun 17, 2022
f1d4537
Update routine.py
Marto32 Jun 17, 2022
dabe299
Update workout.py
Marto32 Jun 17, 2022
a1d0c21
Update workout.py
Marto32 Jun 17, 2022
6ae0f84
Update workout_program.py
Marto32 Jun 17, 2022
d4a1c8c
Update workout.py
Marto32 Jun 17, 2022
da7a05f
Update runner.py
Marto32 Jun 17, 2022
74abcca
Add yoga workouts and change schedule
Marto32 Jul 7, 2022
6992e78
Merge pull request #3 from Marto32/mm/yoga
Marto32 Jul 7, 2022
50d1f0a
Update schedule
Marto32 Jul 25, 2022
b906855
Merge pull request #4 from Marto32/mm/schedchange
Marto32 Jul 25, 2022
727f042
Add trek training program
Marto32 Sep 20, 2022
82ede32
Merge pull request #5 from Marto32/mm/trektrian
Marto32 Sep 20, 2022
4669772
Change workout names
Marto32 Sep 20, 2022
779d854
Updates to include all exercises
Marto32 Sep 20, 2022
ce358ae
Merge pull request #6 from Marto32/mm/trektrian
Marto32 Sep 20, 2022
e17fd93
Change order of workout
Marto32 Sep 22, 2022
1735e94
Merge pull request #7 from Marto32/reorder
Marto32 Sep 22, 2022
fa22480
add links
Marto32 Sep 23, 2022
75697a6
Merge pull request #8 from Marto32/hevylinks
Marto32 Sep 23, 2022
ec0a95f
Add new 531
Marto32 Nov 1, 2022
b70251d
Merge pull request #9 from Marto32/fivethreeone
Marto32 Nov 1, 2022
ffd12a2
Add workout link
Marto32 Nov 3, 2022
2f08a39
Merge pull request #10 from Marto32/fivelink
Marto32 Nov 3, 2022
404ec6a
Add downdog yoga to routine
Marto32 Dec 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions globo/exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,53 @@ def __str__(self):
StepUpVariations = Exercise(
"Step up variations",
"https://www.youtube.com/watch?v=dQqApCGd5Ss")

BarbellOverheadPress = Exercise(
"Barbell Overhead Press",
"https://www.youtube.com/watch?v=_RlRDWO2jfg")

Burpees = Exercise(
"Burpees",
"https://www.youtube.com/watch?v=qLBImHhCXSw")

Pullups = Exercise(
"Pullups",
"https://www.youtube.com/watch?v=eGo4IYlbE5g")

BodyweightSquats = Exercise(
"Squats (bodyweight)",
"https://youtu.be/R1v152b72lo?t=64")

AGTStretchRoutine = Exercise(
"AGT Stretch Routine (follow link)",
"https://agt.degreesofclarity.com/stretching/")

MountainClimbers = Exercise(
"Mountain Climbers",
"https://youtu.be/cnyTQDSE884?t=38")

Bicycle = Exercise(
"Bicycle",
"https://www.youtube.com/watch?v=9FGilxCbdz8")

JumpLunge = Exercise(
"Jump Lunge",
"https://www.youtube.com/watch?v=hTdcOG9muQk")

YogaA = Exercise(
"Yoga with Adriene",
"https://www.youtube.com/watch?v=Yzm3fA2HhkQ")

YogaB = Exercise(
"Yoga with SaraBeth",
"https://www.youtube.com/watch?v=JlG1d00qdo8")

AerobicA = Exercise("Wighted Vest Treadmill (5-15 degree incline, 24+ lbs vest)", "nolink")
Climb = Exercise("Climb (bouldering at VITAL)", "nolink")
LowerA = Exercise("Lower A in Hevy", "https://hevy.com/routine/elcWsErdNLX")
BackA = Exercise("Back A in Hevy", "https://hevy.com/routine/aBDMaIsTVRo")
CoreA = Exercise("Core A in Hevy", "https://hevy.com/routine/DYJ96BcOfV4")
FiveThreeOne = Exercise(
"5/3/1 in Hevy. Review example link for exact schedule.",
"https://docs.google.com/spreadsheets/d/1h7Un7VR1_lgIhGCpaFQComvMB7GLRiRp/edit#gid=127263416")
DownDogYoga = Exercise("DownDog Yoga in app", "nolink")
136 changes: 134 additions & 2 deletions globo/routine.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ class ExerciseRoutine(object):
they will represent one group, or part, of a full workout.
"""

def __init__(self, name, instructions, exercises):
def __init__(self, name, instructions, exercises, include_all=False):
"""Constructor for the ExerciseRoutine object.

Args:
name: `string` The name of hte routine.
instructions: `string` Instructions for the routine.
exercises: `list` A list of `Exercise` objects that make up the routine.
include_all: `boolean` Flag to include all exercises.
"""
self.name = name
self.instructions = instructions
self.exercises = exercises
self.include_all = include_all

self.exercises_for_routine = []

Expand All @@ -33,7 +35,10 @@ def get_exercises(self):
A `list` of `Exercise` objects.
"""
if not self.exercises_for_routine:
self.exercises_for_routine.append(random.choice(self.exercises))
if self.include_all:
self.exercises_for_routine = self.exercises[::]
else:
self.exercises_for_routine.append(random.choice(self.exercises))

return self.exercises_for_routine

Expand Down Expand Up @@ -283,3 +288,130 @@ def get_exercises(self):
instructions=("Perform 10-20 reps of each exercise and go through the circuit 2-3 times. "
"Rest 1-2 mins between circuits."),
exercises=[exercise.AbdominalCircuit])

# r/Fitness beginner routines
BarbellRows = ExerciseRoutine(
name="Barbell Rows",
instructions=("Perform 3 sets of 5 reps, going 1-2 reps before failure on the last set. "
"Finish all 3 sets before moving on."),
exercises=[exercise.BarbellRows])

BenchPress = ExerciseRoutine(
name="Bench Press",
instructions=("Perform 3 sets of 5 reps, going 1-2 reps before failure on the last set. "
"Finish all 3 sets before moving on."),
exercises=[exercise.BarbellBenchPress])

Squats = ExerciseRoutine(
name="Free Squats",
instructions=("Perform 3 sets of 5 reps, going 1-2 reps before failure on the last set. "
"Finish all 3 sets before moving on."),
exercises=[exercise.FreeSquats])

Pullups = ExerciseRoutine(
name="Pullups / Chinups",
instructions=("Perform 3 sets of 5 reps, going 1-2 reps before failure on the last set. "
"Finish all 3 sets before moving on."),
exercises=[exercise.WeightedChinUps])

OverheadPress = ExerciseRoutine(
name="Overhead Barbell Press",
instructions=("Perform 3 sets of 5 reps, going 1-2 reps before failure on the last set. "
"Finish all 3 sets before moving on."),
exercises=[exercise.BarbellOverheadPress])

Deadlifts = ExerciseRoutine(
name="Deadlifts",
instructions=("Perform 3 sets of 5 reps, going 1-2 reps before failure on the last set. "
"Finish all 3 sets before moving on."),
exercises=[exercise.StraightBarDeadlifts])

NoExcusesConditioningA = ExerciseRoutine(
name="No Excuses! (Conditioning)",
instructions=("Perform each exercise one after another with no breaks for "
"4 sets. Exercise time for each set: 60, 45, 30, 15 for 10 "
"minutes total (60x4 + 45x4 + 30x4 + 15x4)."),
exercises=[
exercise.Burpees,
exercise.Pullups,
exercise.BodyweightSquats,
exercise.PushUpVariations,
],
include_all=True
)

NoExcusesConditioningB = ExerciseRoutine(
name="No Excuses! (Conditioning)",
instructions=("Perform each exercise one after another with no breaks for "
"4 sets. Exercise time for each set: 60, 45, 30, 15 for 10 "
"minutes total (60x4 + 45x4 + 30x4 + 15x4)."),
exercises=[
exercise.MountainClimbers,
exercise.JumpLunge,
exercise.Bicycle,
exercise.Burpees,
],
include_all=True
)

AGTStretchRoutine = ExerciseRoutine(
name="Static Stretching!",
instructions="Follow the link for instructions.",
exercises=[exercise.AGTStretchRoutine]
)

YogaForFlexibilityA = ExerciseRoutine(
name="Yoga for Flexibility (A)",
instructions="Do this yoga!",
exercises=[exercise.YogaA]
)

YogaForFlexibilityB = ExerciseRoutine(
name="Yoga for Flexibility (B)",
instructions="Do this yoga!",
exercises=[exercise.YogaB]
)

AerobicTrainingA = ExerciseRoutine(
name="Aerobic Training",
instructions="20-60 minutes of training. Keep HR between 135-145 for Aerobic base training. Then do Trek Back A in Hevy.",
exercises=[
exercise.AerobicA,
exercise.BackA
],
include_all=True
)

AerobicTrainingB = ExerciseRoutine(
name="Aerobic Training",
instructions="20-60 minutes of training. Keep HR between 135-145 for Aerobic base training. Then do Core A in Hevy.",
exercises=[
exercise.AerobicA,
exercise.CoreA
],
include_all=True
)

Climb = ExerciseRoutine(
name="Climb",
instructions="Hit the wall baby!",
exercises=[exercise.Climb]
)

TrekStrength = ExerciseRoutine(
name="Trek Lower A in Hevy",
instructions="Hit it hard.",
exercises=[exercise.LowerA]
)

FiveThreeOneRoutine = ExerciseRoutine(
name="5/3/1",
instructions="Hit it hard.",
exercises=[exercise.FiveThreeOne]
)

DownDogYogaRoutine = ExerciseRoutine(
name="DownDog Yoga",
instructions="Get loose!",
exercise=[exercise.DownDogYoga]
)
4 changes: 2 additions & 2 deletions globo/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
parser.add_argument("--app_password", type=str, help="Your gmail app password to sign into the sender account.", required=True)
parser.add_argument("--recipients", type=str, help="A comma separated list of one or more recipient email addresses.", required=True)

CURRENT_WORKOUT = workout_program.WS4SB
CURRENT_WORKOUT = workout_program.FiveThreeOne

if __name__ == "__main__":
# Parse the command line arguments
Expand All @@ -20,7 +20,7 @@
# See if today is a workout day
if today in CURRENT_WORKOUT.keys():
workout = CURRENT_WORKOUT.get(today)
subject = f"WORKOUT: {workout.name}"
subject = f"{datetime.datetime.today().date()} WORKOUT: {workout.name}"
# Handle newlines in html (yagmail v0.14.245 see https://github.com/kootenpv/yagmail/issues/116)
contents = [workout.as_html().replace("\n","")]

Expand Down
73 changes: 72 additions & 1 deletion globo/workout.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def as_html(self):
routines_formatted = ''.join([routine.as_html() for routine in self.routines])
html = f"""
<p><b>{self.name}</b></p>
<p>Don't forget to <a href="https://www.youtube.com/watch?v=qQ96oXp5RTU">warm up</a>!</p>
<ul>
{routines_formatted}
</ul>"""
Expand Down Expand Up @@ -65,3 +64,75 @@ def __str__(self):
routine.HamstringMovement,
routine.GroundBasedAbCricuit,
])

# r/Fitness beginner workouts
WorkoutA = Workout(
name="Workout A",
routines=[
routine.BarbellRows,
routine.BenchPress,
routine.Squats,
])

WorkoutB = Workout(
name="Workout B",
routines=[
routine.Pullups,
routine.OverheadPress,
routine.Deadlifts,
])

ConditioningA = Workout(
name="Conditioning A",
routines=[
routine.NoExcusesConditioningA,
])

ConditioningB = Workout(
name="Conditioning B",
routines=[
routine.NoExcusesConditioningB,
])

WorkoutAWithConditioning = Workout(
name="Workout A + Conditioning",
routines=[
routine.BarbellRows,
routine.BenchPress,
routine.Squats,
routine.NoExcusesConditioningA,
])

WorkoutBWithConditioning = Workout(
name="Workout B + Conditioning",
routines=[
routine.Pullups,
routine.OverheadPress,
routine.Deadlifts,
routine.NoExcusesConditioningB,
])

StretchWorkout = Workout(
name="Active Recovery",
routines=[
routine.AGTStretchRoutine,
])

YogaWorkoutA = Workout(
name="Yoga - Active Recovery",
routines=[
routine.YogaForFlexibilityA,
])

YogaWorkoutB = Workout(
name="Yoga - Active Recovery",
routines=[
routine.YogaForFlexibilityB,
])

TrekAerobicA = Workout(name="Aerobics and Trek Back A (in Hevy)", routines=[routine.AerobicTrainingA])
TrekAerobicB = Workout(name="Aerobics and Core A (in Hevy)", routines=[routine.AerobicTrainingB])
Climb = Workout(name="Climb", routines=[routine.Climb])
TrekStrength = Workout(name="Strength Training: Trek Lower A (in Hevy)", routines=[routine.TrekStrength])
FiveThreeOneWorkout = Workout(name="5/3/1 (in sheets and Hevy)", routines=[routine.FiveThreeOneRoutine])
DownDogYoga = Workout(name="DownDog Yoga", routines=[routine.DownDogYogaRoutine])
42 changes: 42 additions & 0 deletions globo/workout_program.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import workout

MON, TUE, WED, THU, FRI, SAT, SUN = range(7)
Expand All @@ -9,3 +10,44 @@
FRI: workout.RepetitionUpperBody,
SAT: workout.MaxEffortLowerBody,
}

# r/Fitness beginner routine
# https://thefitness.wiki/routines/r-fitness-basic-beginner-routine/
# Switch back and forth by week so order goes A, B, A, B, ...
WORKOUT_SWITCH = (datetime.datetime.today().isocalendar()[1] % 2) == 0

def _activeRecoverySelector():
triSwitch = (datetime.datetime.today().isocalendar()[1] % 3) == 0
if WORKOUT_SWITCH and triSwitch:
return workout.YogaWorkoutA
elif triSwitch:
return workout.YogaWorkoutB
else:
return workout.StretchWorkout

BasicStrengthTraining = {
MON: workout.WorkoutA if WORKOUT_SWITCH else workout.WorkoutB,
TUE: workout.ConditioningA if WORKOUT_SWITCH else workout.ConditioningB,
WED: workout.WorkoutB if WORKOUT_SWITCH else workout.WorkoutA,
THU: workout.WorkoutA if WORKOUT_SWITCH else workout.WorkoutB,
FRI: _activeRecoverySelector(),
}

TrekTraining = {
MON: workout.TrekAerobicA if WORKOUT_SWITCH else workout.TrekAerobicB,
TUE: workout.Climb,
THU: workout.TrekAerobicB if WORKOUT_SWITCH else workout.TrekAerobicA,
FRI: workout.TrekStrength,
SAT: _activeRecoverySelector(),
SUN: workout.Climb,
}

# See https://thefitness.wiki/routines/5-3-1-for-beginners/
FiveThreeOne = {
TUE: workout.FiveThreeOneWorkout,
WED: workout.DownDogYoga,
THU: workout.FiveThreeOneWorkout,
FRI: workout.Climb,
SAT: workout.FiveThreeOneWorkout,
SUN: _activeRecoverySelector(),
}