Standardized units of measurement for better compatibility with nutritional composition and Open Food Facts #1659
cpopell
started this conversation in
Feature Request
Replies: 3 comments
-
Assuming this gets implemented, is there a nutritional API you suggest for getting the nutrition information? The reason I ask is because it could inform how we do the implementation here, to make sure it plays nice with the nutritional API. Oh I just noticed that then link you shared does have an API. And an SDK. Nice. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Weight/Volume conversion would be amazing! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Before submitting this feature request I have
COMPLETE AND FILL THESE OUT
Please Describe The Problem To Be Solved
As it stands right now, units of measurement are user created. However, there are a primary set of units of measurement that are pretty standard across cooking, in addition to custom ones (like 'unit', 'leg', and so on). I am not saying this is a simple problem, but that it is a semi-standard one.
To calculate the nutritional value of a recipe, you need to total the nutritional value of the ingredients (recognizing this is imperfect - there are processes that change this!) Today, to get the nutritional value of a recipe it either needs to already be available, or you need to calculate it in a separate application that takes you out of mealie.
The first step to fixing this is to have a way to use semi-standard units that can convert between each other, so that either seeded information from OFF or user input can aggregate for recipes.
Users should be able to move between like types of units (weight, volume, etc.) and assign nutrition to whatever the quantity they initially entered for the ingredient.
(Optional): Suggest A Solution
I initially put together a whole unit conversion table here, but it's not that complicated. Cooking measurements are mass, volume, and count (generally speaking).
If you decided to use milliLiters as your standard for volume, for example (rather than liters):
You could always convert between the source and destination via a unitConstant conversion. Unit Types would be Volume, Mass, Count, and Custom (to handle old, non-convertible, customs).
This is only a partial functional rather than technical spec, but it suggests how you would seed this.
We can look at OFF for an example - https://us.openfoodfacts.org/product/8076800195057/spaghetti-n-5-barilla the value returned is both per serving (85g) and standardized amount (100g/1g). Including this in a recipe with, say, the ingredients that also make up tomato sauce, would allow calculation of the final result.
Beta Was this translation helpful? Give feedback.
All reactions