“””
MindMend is a personal wellbeing companion application designed to help users track their mental and
physical health by logging their mood, sleep, and stress levels. The app provides personalized insights and
recommendations based on the data entered, aiming to guide users towards better self-care practices.
“””
from datetime import datetime
wellbeing_data = []
def analyze_wellbeing(mood, sleep, stress):
recommendations = []
if mood is not None:
if mood < 3:
[Link]("Your mood seems low. Consider talking to someone you trust or doing an
activity you enjoy.")
elif mood < 7:
[Link]("Your mood is moderate. Keep focusing on self-care activities to improve
further.")
else:
[Link]("Your mood is good! Keep doing what brings you joy.")
if sleep is not None:
if sleep < 6:
[Link]("You might need more sleep. Aim for 7-8 hours for better energy levels.")
elif sleep > 9:
[Link]("You're sleeping quite a lot. Quality sleep of 7-8 hours might be more
refreshing.")
else:
[Link]("Your sleep duration looks good. Maintain this healthy habit!")
if stress is not None:
if stress > 7:
[Link]("Your stress level is high. Try deep breathing, meditation, or a short walk.")
elif stress > 4:
[Link]("You're experiencing moderate stress. Balance work with relaxation
activities.")
else:
[Link]("Your stress level is well managed. Great job taking care of yourself!")
return recommendations
def display_message(message):
print(message)
def get_current_date():
return [Link]().strftime("%Y-%m-%d")
def add_wellbeing_entry(mood, sleep, stress, notes):
today = get_current_date()
entry = {
"date": today,
"mood": mood,
"sleep": sleep,
"stress": stress,
"notes": notes
}
wellbeing_data.append(entry)
🌈
def display_menu():
print("\n MindMend Menu:")
print("1️⃣ Add Wellbeing Entry")
print("2️⃣ Get Insights & Recommendations")
print("0️⃣ Exit MindMend")
choice = input("Enter your choice (0-2): ")
return choice
👋
def run_mindmend():
display_message(" Welcome to MindMend! Your personal wellbeing companion.")
display_message("Track your mood, sleep, and stress to receive personalized insights.")
while True:
choice = display_menu()
if choice == '1':
try:
mood = float(input("Rate your mood from 1 (low) to 10 (excellent): "))
if not (1 <= mood <= 10):
display_message("Please enter a value between 1 and 10.")
continue
sleep = float(input("How many hours did you sleep last night? "))
if not (0 <= sleep <= 24):
display_message("Please enter a valid number of hours (0-24).")
continue
stress = float(input("Rate your stress level from 1 (low) to 10 (high): "))
if not (1 <= stress <= 10):
display_message("Please enter a value between 1 and 10.")
continue
notes = input("Any additional notes about how you're feeling today? ")
✅
add_wellbeing_entry(mood, sleep, stress, notes)
display_message(" Wellbeing entry added successfully!")
❌
except ValueError:
display_message(" Invalid input. Please enter numeric values for ratings.")
elif choice == '2':
if not wellbeing_data:
display_message("No data available yet. Please add a wellbeing entry first.")
continue
latest_entry = wellbeing_data[-1]
recommendations = analyze_wellbeing(
latest_entry["mood"],
latest_entry["sleep"],
latest_entry["stress"]
✨ ✨
)
display_message("\n === Your Personalized Wellbeing Insights === ")
➡️
for recommendation in recommendations:
✨ ✨")
display_message(" " + recommendation)
display_message(" ===========================================
input("\nPress Enter to return to the main menu...")
💖
elif choice == '0':
display_message(" Thank you for using MindMend! Take care!")
break
⚠️
else:
display_message(" Invalid choice. Please enter 0, 1, or 2.")
if __name__ == "__main__":
run_mindmend()