Inspiration

We were inspired for this from the lack of simple command line calorie and meal tracker interfaces out there and we wanted to make an easy-to-use tool that can help people track their meals without too much bloat.

What it does

This first sets up a user on the first use, asking for information to determine the caloric needs of an individual. When we have a user set up, this has three different modes: add, track, and graph. The add mode allows us to add a single meal to the tracker for the current day and search for different foods to add to the meal as well as the amount of servings. The graph mode gets the data from the past seven days and then graphs the calories for each of those days. Finally, we have a track mode, which tracks the amount of calories one has eaten today.

How we built it

We built this using Python with a SQLite local database using SQLAlchemy and Flask. To use a command line interface, we also added a package which is able to parse arguments as well.

Challenges we ran into

We had some challenges being able to get some of the database working, with a lot of 500 internal server errors that happened while trying to add new foods and meals to the tracker database file.

Accomplishments that we're proud of

This was our first hackathon, so we're definitely proud of having a completed project that is functional. We're also proud of the search engine for foods that uses the USDA API as well as the graph that displays the calories in the week. Both of these took some significant work, but we got it in a form that was clear, neat, and functional.

What we learned

We learned how to make API requests using Python. In addition, we also learned how to make an executable Python shell script as well as do argument parsing as well. We also learned how to make a mini search engine for foods as well.

What's next for CalCount

After this hackathon, we also plan to add capability for users to add previous meals on past dates and also edit meals that have been already added by being able to add or remove certain food items. We could also have a way to track other nutrients as well.

Share this project:

Updates