Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninja-za authored Dec 29, 2024
1 parent 31f6409 commit 31c3bb0
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,14 @@

app = Flask(__name__)

# Load exercises from JSON file
def load_exercises():
with open('exercises.json', 'r') as f:
data = json.load(f)
return data['legs'], data['arms'], data['core']

legs = [
"Goblet squat", "Racked squat", "Squat to press",
"Single arm squat to press (thruster)", "Side lunge",
"Lunge", "Deadlift", "Single arm dead lift"
]

arms = [
"Push-ups", "Pike push-up", "Alternate side press-ups",
"Press-up on kettlebell", "Press-up move kettlebell",
"Press-up lift", "Clean", "Clean and press",
"Single arm press", "Lying press", "Double press",
"Swings", "Bent over row", "Single arm row",
"Around the world", "Turkish get-up"
]

core = [
"Side plank raises", "Plank", "Plank to press-up",
"Sit-ups", "Russian twists", "Twist superman",
"Hip raises", "Leg raises", "Lean on sofa and lift body",
"Abdominal scissors"
]
# Load exercises when the app starts
legs, arms, core = load_exercises()

def ran(num1, num2, num3):
leg_exercise = random.choice(num1)
Expand All @@ -40,7 +26,6 @@ def home():

@app.route("/create_workout", methods=["GET"])
def create_workout():

core_exercise, arm_exercise, leg_exercise = ran(legs, arms, core)
return jsonify({
'core': core_exercise,
Expand Down

0 comments on commit 31c3bb0

Please sign in to comment.