July 14, 2007 will

Food File is now Open Source

Food FileFood File is one of the first moderately sized wxPython applications I wrote. It is a rich interface to the US Department of Agriculture nutrition database, with html output and neat 3D pie-charts (everyone loves a good pie-chart)! For a while I was selling it commercially, but it didn't do so well - probably because I'm not a great business man. I'm an engineer. I make things, I just can't seem to sell them! So I gave it away for free and tried to make money from Google Ads, which worked for a while, but it became so popular that my bandwidth bills overtook the pittance I got from the ads.

The consequence of this tale of woe is that I have released Food File as open source, so that I can collect on karma rather than hard cash. The source and Win32 installer is now available on Google Code, so those nice folks at Google can pick up the bandwidth bill. I hear they are not short of a few cents.

Food File downloads

Food File was written quite hastily, and then tweaked and enhanced over a few months. The code could be better, but I'm fairly pleased with the end result. It does some pretty cool things, like updating the search as you type and rendering neat 3D pie-charts. The nutrition database is actually stored as a large flat-file, which is how it is shipped. I did investigate using an SQL solution, but it turns out that a brute-force search of 7000+ items on a list can be done in the blink of an eye. Go Python. The source may be useful to anyone interested in writing a wxWindows application, there are a few gems that could be ripped out.

I probably wont be maintaining this project, which is a shame because there are many enhancements that could be done. I'm hoping that somebody will offer to take over the project and add some polish and new features. Installers for other platforms would also be appreciated. If you would like to help, let me know!

Use Markdown for formatting
*Italic* **Bold** `inline code` Links to [Google](http://www.google.com) > This is a quote > ```python import this ```
your comment will be previewed here

What you need to do is find a partner to sell your software for you if you don't want to take the (rather large) amount of time to do it yourself. This is what I did and it works out pretty well! :)

gene brown

I have tried very hard and long to find a nutritional guide to aid me with my diabetes. You have supplied me with what I was looking for. May God richly bless and keep you.
Thank You and Thank you,
If and when you upgrade food file could I be notified?
gene brown


Glad you like it Gene!

I'll post on my blog when it is updated. It probably wont change much, but I will update the database from time to time.


Will, Tonight I was searching for python s/w tools to implement a project I have in mind, and I've ended up enjoying reading many pages on your blog. Thanks. Such is the www.

I am going to buy your pygame dev book for sure. At least to learn many good things, all new to me. Plus the wxpython in action book has just arrived to me via post. But pygame and wxpython don't seem to mix well (or at all) - do they?

I notice your Food File program uses 3D opengl. Your glcanvas code is impressive, but it also looks fairly low level. Python I love. But game and general GUI control programming is new to me.

What python s/w tools would you choose if you wanted to create a cross platform (MS-Win, Mac-OSX and Linux) python program which has an interactively modified/rendered 2D pie chart with text labeling, and around that you also needed some typical GUI controls, like a a data entry panel, and file/edit pull down menus, all in the OS native GUI look and feel?

I did not know this would be so difficult. Hopefully it isn't. After a little research (and seeing your program) it appears that glcanvas + wxpython is a perfectly viable option. But pygame sounds like it would be simpler.

Any advice appreciated, and hopefully of interest to some others.


Hi Emmett,

You are right that wxPython and Pygame don't mix well. I wouldn't go down that route.

Pygame does have GUI support via external libraries, so you could write an app you describe with Pygame. But if you want your app to have a native look and feel and not look too out of place with the OS then I would suggest using wxPython, which works well with OpenGL. The wxPython in Action book is highly recommended and should get you started quickly.

Hope that helps!



i downloded food file and its great application.
However, the mose inportant feature is missing, the ability to add my own foods to the database. for example i want to use it here in israel and lots of the candies we have here are mising from your database.

the next phase will be using the database to build a balanced diet. :)


Thank you for this file. It is most helpful for dietary planning. How do you make it smaller? I enlarge it and it won't return to the smalle screen-shot? Also, how do I include it on a website?

Thank you very much

How can I install it on my wife's linux netbook?
I'ts python, so I suppose I can.

- bookmarks for most used foods
- a recipe calculator
- translation of the db to italian ;-), anybody out there that maso?
Kate from kenya
Thank you so much for the food file….you have literally saved my health. Be blessed.
Hi, I am rowking on a project to develop a diet diary application for a particular target group. Would I be able to use your application as my food database? Thanks
Will McGugan
Lilka, as long as you don't charge for it, sure.
Great, cheers