DotNetCore.NutriScore
1.0.0
dotnet add package DotNetCore.NutriScore --version 1.0.0
NuGet\Install-Package DotNetCore.NutriScore -Version 1.0.0
<PackageReference Include="DotNetCore.NutriScore" Version="1.0.0" />
paket add DotNetCore.NutriScore --version 1.0.0
#r "nuget: DotNetCore.NutriScore, 1.0.0"
// Install DotNetCore.NutriScore as a Cake Addin
#addin nuget:?package=DotNetCore.NutriScore&version=1.0.0
// Install DotNetCore.NutriScore as a Cake Tool
#tool nuget:?package=DotNetCore.NutriScore&version=1.0.0
NutriScore
Library to calculate the Nutri-Score value
Introduction
Nutri-Score, named as 5-CNL too, is a nutrition label created by the French government (the Santé Publique France) in March 2017.
This label could be used on food products to show relevant infomation about it to the consumers.
NuGet Package
You can install the Nuget Package of DotNetCore.NutriScore from here
Using the library DotNetCore.NutriScore
This library has one internal class named NutriScoreTypes, two entities named NutriScoreInputValues and NutriScoreResult, and one class named NutriScoreCalculator.
NutriScoreTypes has the data details needed to calculate the Nutri-Score value of a product.
NutriScoreInputValues is an entity with the input values needed to calculate the Nutri-Score value of a product.
NutriScoreCalculator is the class used to calculate the Nutri-Score value of a product.
-- NutriScoreResult is the class used to return the Nutri-Score value of a product.
How to
// Using namespaces
using DotNetCore.NutriScore;
using DotNetCore.NutriScore.Entities;
// Calculate the Nutri-Score values (score and group)
var nutriScoreInputValues = new NutriScoreInputValues(energy, sugars, saturatedFats, sodium, fibers, proteins, fruitsPercentage);
var nutriScoreCalculator = new NutriScoreCalculator();
var isSolidProduct = false;
var nutriScoreResult = nutriScoreCalculator.Get(nutriScoreInputValues, isSolidProduct);
Countries that recommends use Nutri-Score
Nutri-Score is recommemded to be used in The Netherlands, Germany, France, Belgium and Spain. In other countries as Portugal, Switzerland, Slovenia or Austria, the use of Nutri-Score is not officially recommended by the authorities.
However, the European Commission and WHO - World Health Organization are starting to recommend it.
By the moment, the use of Nutri-Score is a recommendation
How is the Nutri-Score calculate
The value of Nutri-Score is calculated from seven (7) different parameters of nutrient information per 100 grams.
These parameters are: energy, sugars, saturated fats, sodium, fibers, proteins and fruits percentage.
These nutrients are group by:
Preferable parameters: fibers, proteins and fruits percentage.
Detrimental parameters: energy, sugars, saturated fats and sodium.
Furthemore, there are two type products (solid products and beverage products).
The Nutri-Score should be calculated for each type of product and for all nutrients.
The final Nutri-Score value will return an score value and a group.
This group could be A/B/C/D/E, being A a best healthy product than an E product.
Each letter has a colour that identifies the score better.
Inside of each parameter of nutrient there are different range values and a final result depending of the nutrient value.
The preferable and detrimental values are calculated based in an algorithm.
Algorithm:
Values for Nutri-Score
Is Nutri-Score an efficient and correct value?
Nutri-Score is easy to understand by the consumer, however is not completly correct.
For example, products as olive oil has not a good result and is not true.
Due this, some countries as Spain does not recommend use Nutri-Score for olive oils is not recommended.
In fact, there are doubts with products with one only ingrediente too to apply Nutri-Score in them.
Companies using Nutri-Score
Companies as Nestlé, Auchan, Eroski or Danone are including the Nutri-Score label in their products.
There are more companies trying to apply Nutri-Score in their products.
You will find more information about Nutri-Score here
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|
First version of the library