Spaces:
Sleeping
Sleeping
| from docx import Document | |
| # Dummy data | |
| data = { | |
| "Day": ["Day 1", "Day 2", "Day 3", "Day 4", "Day 5"], | |
| "Breakfast": [ | |
| "Oatmeal with sliced bananas and honey", | |
| "Scrambled eggs with toast and orange juice", | |
| "Greek yogurt with granola and berries", | |
| "Pancakes with maple syrup and strawberries", | |
| "Smoothie (spinach, banana, yogurt, almond milk)" | |
| ], | |
| "Lunch": [ | |
| "Grilled chicken salad with mixed greens and vinaigrette", | |
| "Turkey sandwich with lettuce, tomato, and chips", | |
| "Vegetable soup with whole-grain roll", | |
| "Tuna salad wrap with carrot sticks", | |
| "Caesar salad with grilled shrimp" | |
| ], | |
| "Dinner": [ | |
| "Spaghetti with marinara sauce and garlic bread", | |
| "Baked salmon with steamed broccoli and rice", | |
| "Beef stir-fry with mixed vegetables and noodles", | |
| "Chicken curry with basmati rice", | |
| "Veggie pizza with side salad" | |
| ] | |
| } | |
| # Create DOCX document | |
| doc = Document() | |
| doc.add_heading("5-Day Meal Plan", level=1) | |
| for i in range(5): | |
| doc.add_heading(data["Day"][i], level=2) | |
| doc.add_paragraph(f"Breakfast: {data['Breakfast'][i]}") | |
| doc.add_paragraph(f"Lunch: {data['Lunch'][i]}") | |
| doc.add_paragraph(f"Dinner: {data['Dinner'][i]}") | |
| doc.add_paragraph("") | |
| # Save file | |
| path = "5_day_meal_plan.docx" | |
| doc.save(path) | |
| print(f"Saved DOCX file to: {path}") | |