TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.49k stars 578 forks source link

Unit Conversion / Ingredient Property Calculation #2374

Open vabene1111 opened 1 year ago

vabene1111 commented 1 year ago

wip on https://github.com/TandoorRecipes/recipes/tree/feature/unit-conversion

Notes

US/UK weight https://github.com/hgrecco/pint/blob/master/pint/default_en.txt#L588

US liquid volume https://github.com/hgrecco/pint/blob/master/pint/default_en.txt#L566 US other volume https://github.com/hgrecco/pint/blob/master/pint/default_en.txt#L577 (probably best to only include cup?)

UK Imperial Volumes https://github.com/hgrecco/pint/blob/master/pint/default_en.txt#L635

rest of the world weight: g, kg rest of the world volume: ml, (cl), (dl), l (only convert to ml/l but convert from others)

Food Nutrition APIS

vabene1111 commented 1 year ago

The openfoodfacts database seems to be the best source for international nutritional values

https://wiki.openfoodfacts.org/API/Read/Search

current problem: searching the database returns very fuzzy results which often means people have to read trough hundres if not thousands of results to find a usable product.

Need to find a way to filter results better so less products not relevant to the search are returned.

-> main search endpoint does not allow to search for only product_name -> ingredient/category endpoints do not allow any filters at all

Maybe script to build own product name database ?

jeffward01 commented 1 year ago

Perhaps offer an ability to use 'free' developer API key's of Edamam Food Database API

To enable the feature (or perhaps, as a requirement) - each user will need to supply their own API key for this website.

Here is a screenshot of the feature from the API's 'demo' page:

image

vabene1111 commented 1 year ago

very interesting API, we are currently working on a tandoor specifc database but maybe the edamam API can help there too.

DanielVoogsgerd commented 1 year ago

I'm not sure if this is the right place for a feature request concerning ingredient calculation, but it would be really nice if we could sort the ingredients, as sources are often consistently ordered a certain way.

Also, I've started testing this feature out and so far it works wonders. I do wonder however how much chance there is of feature related data loss, as it does determine how much effort I (and probably others) can afford testing it out.

Again, I'm loving the feature so far, and can't wait to see what its potential is.

smilerz commented 1 year ago

I'm not sure if this is the right place for a feature request concerning ingredient calculation, but it would be really nice if we could sort the ingredients, as sources are often consistently ordered a certain way.

Also, I've started testing this feature out and so far it works wonders. I do wonder however how much chance there is of feature related data loss, as it does determine how much effort I (and probably others) can afford testing it out.

Again, I'm loving the feature so far, and can't wait to see what its potential is.

I don’t understand your request. Ingredients are already ordered.

DanielVoogsgerd commented 1 year ago

Ah, sorry, I mistakenly wrote ingredients instead of ingredient properties.

Maybe I'm overlooking something, but as far as I know, ingredient properties don't have a way to be ordered in a user-defined way. I think the properties are sorted by default on their primary key id, so basically in order of creation. However, nutrient information in my country is almost always ordered in a specific way. So I have to remove the default fields and create them in the right order.

vabene1111 commented 1 year ago

Yes that's something I want to do, also wanted to allow some markup about how different things are rendered.but good idea with the order.

Regarding data loss: although the feature is considered beta /new I don't expect to do anything that would break existing data.

wligtenberg commented 8 months ago

I am interested in helping out with the allergen feature. I think a property could be used, but then maybe a boolean type. Possible it needs a rule to determine how to combine values. Should all be true, or any? Something like that. I am looking to add allergy information to the recipes, then obviously it would be an "any" rule. Maybe we could predefine some well known allergies, and use the correct icons for those as well.

vabene1111 commented 8 months ago

Feel free to spin up a concept, probably best in a seperate issue and we can discuss how it could be done.

DonDebonair commented 2 months ago

Question: once this feature is merged, will this allow users to select what units they want to view recipes in?

vabene1111 commented 2 months ago

Preferred viewing units are not yet implement but are something that I want to do at some point