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!

This blog post was posted to It's All Geek to Me on Saturday July 14th, 2007 at 6:31PM
 

12 Responses to "Food File is now Open Source"

  • July 30th, 2007, 4:27 a.m.

    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
    August 1st, 2007, 7:22 p.m.

    Will;
    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

  • August 2nd, 2007, 10:42 a.m.

    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.

  • Emmett
    August 30th, 2007, 3:51 p.m.

    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.

  • September 5th, 2007, 2:28 p.m.

    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!

    Will

  • hanan
    February 3rd, 2008, 2:44 p.m.

    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. :)

  • Fine
    December 20th, 2008, 1:47 p.m.

    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

  • andrea
    July 26th, 2009, 5:54 p.m.

    How can I install it on my wife's linux netbook?

    I'ts python, so I suppose I can.

    Wishlist:

    - bookmarks for most used foods

    - a recipe calculator

    - translation of the db to italian ;-), anybody out there that maso?

  • Kate from kenya
    February 11th, 2012, 1:05 p.m.

    Thank you so much for the food file….you have literally saved my health. Be blessed.

  • Lilka
    December 4th, 2012, 2 p.m.

    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

  • December 4th, 2012, 2:03 p.m.

    Lilka, as long as you don't charge for it, sure.

  • Lilka
    December 4th, 2012, 2:03 p.m.

    Great, cheers

Leave a Comment

You can use bbcode in the comment: e.g. [b]This is bold[/b], [url]http://www.willmcgugan.com[/url], [code python]import this[/code]
Preview Posting...
Previewing comment, please wait a moment...

My Tweets

Will McGugan

My name is Will McGugan. I am an unabashed geek, an author, a hacker and a Python expert – amongst other things!

Search for Posts
Possibly related posts
Tags
Popular Tags
 
Archives
2013
 
Recent Comments
Nice PicsI saw all 25 Dragon Fly Picsin Flicr
- S I M H A on Dragon Fly
Hey Will thanks for the information. I will keep that in mind.
Hey Will thanks for the information. I will keep that in mind.
Hey Will thanks for the information. I will keep that in mind.
Sir, can you give me full code.?
 
© 2008 Will McGugan.

A technoblog blog, design by Will McGugan