Recipe generator for randomized meal planning
Why not list out the recipes yourself, say onto cards or something, and then randomly draw them - by pulling cards from the box, or by numbering them and rolling dice, or whatever. Then build the week's shopping list from the list of meals. If each meal is balanced there's no need to write code to optimize for the week. And since you have free will, if you pull 3 meals in a row that are really similar (meatloaf, hamburgers, shepherds pie) you are free to swap Tuesday and Friday, or to toss one back and draw again.

If you plan to eat leftovers roughly half the time, don't draw 7 meals for a week, draw 4. In our house, certain meals have "official" leftover dishes that are made from them. You could just write that on the card: "make leftovers into pulled pork sandwiches the next day."