I am doing some volunteer coding for a food bank in Canada.
We would like to quickly calculate the total calories in an entire hamper of food. The hamper is a couple of cardboard boxes that have three weeks worth of food, which the client takes home and presumably eats.
What I’d like to do is to scan each grocery item in the hamper, and have a total number of calories displayed. I’m using a barcode scanner and the API to lookup the calorie count, and that works very well—however:
Not all products have the total weight (or volume) of the entire package. Almost everything has serving size, and calories per serving (wonderful!), but I don’t know how to compute total calories in the entire package.
Is there something I’m missing? Some magical field that tells you total servings per package maybe?
The short answer is that you can’t if you don’t have a total weight AFAIK, as you should at least do something like total_weight / serving_size * calories_per_serving.
When creating a product the total weight is one of the fields that we ask for initially. Additionally, nutritional values are usually expressed as xxx/100 g (at least here in Italy), so I find it a little strange that some product have calories per serving but not a total weight specified.
Either ways you could help us by “playing” the “Hunger games”, which is a webapp that lets you answer AI generated question about things that AIs are good at, like reading product weights from product photos.