Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "flavor"/"server type" to products #972

Closed
monsieurtanuki opened this issue Sep 12, 2024 · 5 comments · Fixed by #973
Closed

Add a "flavor"/"server type" to products #972

monsieurtanuki opened this issue Sep 12, 2024 · 5 comments · Fixed by #973
Assignees
Labels
🏄‍♀️ good first issue Good for newcomers 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts

Comments

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Sep 12, 2024

Why - Problem description

In order to manage off, obf, opf and opff at the same time, we need some additional data.
Each product, each barcode should be associated with a flavor.

What - Proposed solution

Make flavor a new product field.
That flavor may be provided by the server in a near future, but regardless, we get it from the server we're extracting the data from:

  • a URL is used for product search
  • from this URL (e.g. world.openbeautyfacts.org) we get a flavor (e.g. obf)
  • we download related product data
  • for each product data we download, we populate the flavor product field
  • some day, when the server is ready, it can populate itself the flavor product field

Additional questions

  • We already have Flavor (off, obf, opf, opff and off-pro) for Prices and ServerType (off, obf, opf and opff) for Robotoff.
    Which one should we use for our Products? Or should we just stick to a mere String for more flexibility?
  • As the field is supposed to be populated directly by the server in the future, what json tag would it be? flavor, source?

cf. openfoodfacts/smooth-app#4540

@monsieurtanuki monsieurtanuki added 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 📸 Open Products Facts 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 🏄‍♀️ good first issue Good for newcomers labels Sep 12, 2024
@monsieurtanuki
Copy link
Contributor Author

  • We already have Flavor (off, obf, opf, opff and off-pro) for Prices and ServerType (off, obf, opf and opff) for Robotoff.
    Which one should we use for our Products? Or should we just stick to a mere String for more flexibility?
  • As the field is supposed to be populated directly by the server in the future, what json tag would it be? flavor, source?

@teolemon Those are blocking questions. Any answer would help solve the issue, and tons of related issues in Smoothie.

@stephanegigandet
Copy link
Contributor

@monsieurtanuki please use the "product_type" field instead, with values "food", "beauty", "petfood" and "product". This is the field that will be added in the OFF database and API.

@stephanegigandet
Copy link
Contributor

flavors may go away, it's better to use product_type

@raphodn
Copy link
Member

raphodn commented Sep 13, 2024

Ok good to know !

In https://github.com/openfoodfacts/open-prices I currently store it under Product.source.

Also to note that we should update the openfoodfacts-python package : https://github.com/openfoodfacts/openfoodfacts-python/blob/8d1013a01c8fa674c1c84fd1729b73c621b5edd3/openfoodfacts/types.py#L11 to also store/return these values (food, beauty, petfood, product) somehow :)

@teolemon
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏄‍♀️ good first issue Good for newcomers 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts
Development

Successfully merging a pull request may close this issue.

4 participants