This is not something which fits in with the general theme of my blog, but it does involve programming. One of the things which I find irritating, wasteful and unnecessarily time consuming, is grocery shopping. If you want a lean grocery list with little waste, you need to spend time writing a list. If you don't have the time to write a list, you end up impulse buying and then eventually throwing out something when it starts going bad.
I decided that a little bit of programming would resolve this issue. What I resolved to do is type up an XML file with meals and the ingredients required of that meal. For example:
<meal title="Fish and Chips with Peas">
<item title="Breaded Fish Portion" amount="4" cost="x.xx"></item>
<item title="Chips" amount="1" cost="x.xx"></item>
<item title="Peas" amount="1" cost="x.xx"></item>
I then used XPath to walk over the XML file, creating a collection of objects. Then X (user-defined) meals are selected at random. The ingredients of each meal are collected together (aggregating the amounts for equivalently named ingredients) and a shopping list is generated. The costs of the ingredients are also aggregated to produce an estimate of the cost of your shopping trip.
My plans for this small application are to also add items which are recurring buys such as coffee, sugar, soap..etc. I am at this stage unsure of how to go about with this. Do I simply tack it onto every shopping list and then check my supplies? I think the best way would be to integrate this with an inventory-style system so that your list would be checked against your stock levels, effectively filtering out the items you already have from your final shopping list. I just wonder on the practicality of keeping an inventory system in a small household.