Skip to content

feat: add Nutri-Score % of fruits / vegetables / nuts / legumes from GS1 #12005

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

stephanegigandet
Copy link
Contributor

GS1 has added support for some fields that are necessary to compute the Nutri-Score, like adding the % of fruits / vegetables / legumes. We do get some of those from some producers (e.g Bonduelle, but for the old Nutri-Score fields it seems).

This PR adds some support + some comments and links in the code.

There are more fields we could add (which category should be used for the Nutri-Score: fats, nuts etc.). But so far I have not seen it in the data we receive yet.

@stephanegigandet stephanegigandet requested a review from a team as a code owner June 9, 2025 14:24
@github-project-automation github-project-automation bot moved this to To discuss and validate in 🍊 Open Food Facts Server issues Jun 9, 2025
@github-actions github-actions bot added 🧪 tests 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. labels Jun 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.56%. Comparing base (92d859c) to head (fcfa811).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12005   +/-   ##
=======================================
  Coverage   50.56%   50.56%           
=======================================
  Files          84       84           
  Lines       22920    22920           
  Branches     5509     5509           
=======================================
  Hits        11589    11589           
  Misses       9917     9917           
  Partials     1414     1414           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stephanegigandet
Copy link
Contributor Author

New fields in GS1 data model:

https://navigator.gs1.org/gdsn/class-details?name=NutritionalProgramIngredientTypeCode&version=12

As of 2025/06/01, the nutritionalProgramIngredients values seem to refer to the old Nutri-Score formula
There seems to be new fields for the new formula:

https://www.gs1.nl/kennisbank/gs1-data-source/levensmiddelen-drogisterij/welke-data/nutri-score/ (in Dutch)

@hangy
Copy link
Member

hangy commented Jun 11, 2025

/update_tests_results

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fruits & Vegetables GS1 The producer platform is integrating with the GS1 product data formats. GS1 manages barcodes. 🚦 Nutri-Score 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers 🧪 tests
Projects
Status: To discuss and validate
Status: In progress
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants