I have built this myself. It’s been evolving for ten years now and started as a motley pile of XML and shell scripts. Now it’s an SQLite database and a Haskell program to drive it. I use GNU roff to print the grocery list.
I won’t claim this saved any time over using some app, but it does work exactly how I want it.