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

Improve OFF import #1506

Open
rolandgeider opened this issue Nov 26, 2023 · 0 comments
Open

Improve OFF import #1506

rolandgeider opened this issue Nov 26, 2023 · 0 comments

Comments

@rolandgeider
Copy link
Member

rolandgeider commented Nov 26, 2023

At the moment, when importing a current OFF dump with a threshold of 0.7 completeness, around 230 000 products can't be imported because the extract_info_from_off function can't extract the necessary information.

Most products fail because some of these fields are missing

  • energy-kcal_100g
  • proteins_100g
  • carbohydrates_100g
  • sugars_100g
  • fat_100g
  • saturated-fat_100g

Possible solutions

Convert the energy, when the energy is only available in kj per 100g and not in kcal (energy-kj_100g), the conversion is easy

Ignore less important ones (sugars_100g and saturated-fat_100g) and just set their values to 0

Calculate the rest if the infos are available, read serving_quantity and e.g. carbohydrates_serving and convert this to a per-100g value. This probably has some tricky edge cases and we should take a look at what other fields / flags we have access to in the dump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant