campcooking - a recipe builder for camps

2022-12-17

Christian holiday camps that I've been part of in the past often have to cater for a large number of people, each of whom have a different set of food allergies and intolerances. As a result, before each camp somebody needs to work out a full recipe book, including substitutions for the main recipes. This takes a very long time, but could be largely automated by a simple program.

This program would, for a given set of people with dietary restrictions and a given recipe, allow a set of recipes to be constructed that could cater for everyone. These recipes should be as close to each other as possible, so that everyone has nearly the same food. The number of recipes should also be minimised to save cooking effort.

The simplest possible version of this will simply highlight which ingredients in the main recipe require substituting. More advanced versions could consider substitution suggestions, calculations to scale quantities, and calculating a procedure to share common elements between the recipes, saving effort.

I could see this more advanced web application being a possible startup idea, since this would add value in food preparation contexts such as camps and schools where the same people are often served.

The MVP requires a recipe builder library that can perform the necessary calculation, alongside some sort of front end to run the script. This could look like a simple web API, or alternatively JSON or CSV processing script. The currently open problems are:

a recipe representation

This could take the form of a reduced schema.org recipe. This could be encoded as a Pydantic model, and represented in a database through an ORM such as sqlalchemy.

an allergen representation

This would specify which number of people have which allergens.

a map of ingredients to allergens

This maps ingredients, such as "apple", to the allergen food group, e.g. "fruit". Needless to say, this should be based on open data. If sufficiently complete, it would allow a trivial search through the recipe ingredients to determine which allergens are present. However, the problem is non-trivial due to ingredients that themselves have sub-ingredients; for example, "apple sauce" contains "apple", and is therefore in allergen food group "fruit".

Unfortunately an open database for this doesn't seem to exist, or at least it's not easy to find. The most relevant is this open dataset on food allergens, but it's Swiss and not particularly complete. This StackOverflow post searching for some open data didn't recieve a satisfactory response.

Some databases exist which go really deep into allergen protein structures, but are not really useful to this project, e.g. https://foodb.ca

Several proprietary offerings exist, including:

A good first step would be building this map out.

Articles from blogs I read

Hugo: rename a tag

This blog is rendered by the means of a static site generator (SSG) called Hugo. Each blog post has a set of one or more tags associated to it. The more posts I create, the more consolidated the tags become. Sometimes I need to rename tags after-the-fact to …

via Not Just Serendipity January 29, 2024

Why Prusa is floundering, and how you can avoid their fate

Prusa is a 3D printer manufacturer which has a long history of being admired by the 3D printing community for high quality, open source printers. They have been struggling as of late, and came under criticism for making the firmware of their Mk4 printer non-…

via Drew DeVault's blog December 26, 2023

attribution armored code

Attribution of source code has been limited to comments, but a deeper embedding of attribution into code is possible. When an embedded attribution is removed or is incorrect, the code should no longer work. I've developed a way to do this in Haskell that…

via see shy jo November 21, 2023

Generated by openring