From 280fc292a43500ba2e1b458434f17c901ea32d72 Mon Sep 17 00:00:00 2001 From: Xavier Desoindre Date: Mon, 25 Nov 2024 17:20:56 +0100 Subject: [PATCH] temp --- .../overScreens/Data/AlimentationData.tsx | 16 +- src/data/categories/alimentation.json | 1674 ++++++++++++++++- src/data/categories/repas.json | 89 + src/providers/locales/en.json | 1 + src/providers/locales/es.json | 1 + src/providers/locales/fr.json | 1 + src/scripts/buildFromAgribalyse.ts | 37 +- src/scripts/buildFromEmpreinte.ts | 8 +- types/equivalent.d.ts | 5 +- 9 files changed, 1736 insertions(+), 96 deletions(-) create mode 100644 src/data/categories/repas.json diff --git a/src/components/shareable/overScreens/Data/AlimentationData.tsx b/src/components/shareable/overScreens/Data/AlimentationData.tsx index b9f564421..5f8fc7a3d 100644 --- a/src/components/shareable/overScreens/Data/AlimentationData.tsx +++ b/src/components/shareable/overScreens/Data/AlimentationData.tsx @@ -1,4 +1,3 @@ -import React from 'react' import useParamContext from 'src/providers/ParamProvider' import Link from 'components/base/buttons/Link' import styles from './Data.module.css' @@ -30,6 +29,11 @@ const FRAlimentationData = () => { Moyenne des facteurs d’émission de la côte de veau, épaule de veau, escalope de veau, noix de veau, poitrine de veau et riz de veau +
  • + Porc : Impact carbone = 9,66 kg de CO2e / kg +
    + Moyenne des facteurs d’émission de la côte de porc, échine de porc, poitrine de porc, épaule de porc +
  • Dorade royale : Impact carbone = 10,8 kg de CO2e / kg
    @@ -107,6 +111,11 @@ const ESAlimentationData = () => { Promedio de los factores de emisión de costilla de ternera, paleta de ternera, escalope de ternera, nuez de ternera, pecho de ternera y molleja de ternera
  • +
  • + Cerdo: Impacto de carbono = 9,66 kg de CO2e / kg +
    + Promedio de los factores de emisión de chuleta de cerdo, paleta de cerdo, panceta de cerdo, lomo de cerdo +
  • Dorada: Impacto de carbono = 10,8 kg de CO2e / kg
    @@ -161,6 +170,11 @@ const ENAlimentationData = () => { Average of emission factors for veal rib, veal shoulder, veal escalope, veal nut, veal breast, and veal sweetbread
  • +
  • + Pork: Carbon impact = 9.66 kg CO2e / kg +
    + Average of emission factors for pork chop, pork shoulder, pork belly, pork loin +
  • Gilthead seabream: Carbon impact = 10.8 kg CO2e / kg
    diff --git a/src/data/categories/alimentation.json b/src/data/categories/alimentation.json index d4aaea206..fc0f85a62 100644 --- a/src/data/categories/alimentation.json +++ b/src/data/categories/alimentation.json @@ -1,89 +1,1593 @@ [ { - "id": 20689, - "name": "Repas avec du boeuf", - "synonyms": ["manger", "alimenter", "viande"], - "slug": "repasavecduboeuf", - "category": 2, - "total": 7.26, - "default": true, - "tile": true, - "meta": { - "title": "Repas boeuf", - "description": "Un repas avec du boeuf a un impact important sur le climat. Mesurez votre impact en découvrant la valeur en CO₂e de votre repas" - }, - "source": "https://base-empreinte.ademe.fr/documentation/base-carbone?docLink=Repas" - }, - { - "id": 20683, - "name": "Repas végétarien[s]", - "synonyms": ["manger", "alimenter"], - "slug": "repasvegetarien", - "category": 2, - "total": 0.51, - "default": true, - "tile": true, - "meta": { - "title": "Repas végétarien", - "description": "Un repas avec du boeuf, un repas avec du poulet, ou un repas végétarien aura un impact différent sur le climat. Quel est l'impact d'un repas végétarien ?" - }, - "source": "https://base-empreinte.ademe.fr/documentation/base-carbone?docLink=Repas" - }, - { - "name": "Repas végétalien[s]", - "synonyms": ["manger", "alimenter"], - "slug": "repasvegetalien", - "category": 2, - "total": 0.39, - "default": true, - "tile": false, - "meta": { - "title": "Repas végétalien", - "description": "Découvrez l'impact climat d'un repas végétalien et comparez-le à l'impact climat d'un repas avec du boeuf ou avec du poulet" - }, - "source": "https://nosgestesclimat.fr/documentation/alimentation/plats/v%C3%A9g%C3%A9talien/empreinte" - }, - { - "name": "Repas avec du poisson blanc", - "synonyms": ["manger", "alimenter"], - "slug": "repasavecdupoissonblanc", - "category": 2, - "total": 1.98, - "default": true, - "tile": false, - "meta": { - "title": "Repas poisson blanc", - "description": "Découvrez la différence de l'impact climat entre un repas avec du poisson blanc et un repas avec de la viande. Mesurez votre empreinte carbone" - }, - "source": "https://nosgestesclimat.fr/documentation/alimentation/plats/poisson-2/empreinte" - }, - { - "name": "Repas avec du poisson gras", - "synonyms": ["manger", "alimenter"], - "slug": "repasavecdupoissongras", - "category": 2, - "total": 1.11, - "default": true, - "tile": false, - "meta": { - "title": "Repas poisson gras", - "description": "Voici l'impact émis par repas avec du poisson gras comprenant la fabrication, la distribution et la consommation" - }, - "source": "https://nosgestesclimat.fr/documentation/alimentation/plats/poisson-1/empreinte" - }, - { - "id": 20688, - "name": "Repas avec du poulet", - "synonyms": ["manger", "alimenter", "viande"], - "slug": "repasavecdupoulet", - "category": 2, - "total": 1.58, - "default": true, - "tile": false, - "meta": { - "title": "Repas poulet", - "description": "Quelle est la différence sur le climat entre un repas avec du poulet, un repas avec du boeuf, ou un repas végétarien ? Mesurez votre impact sur le climat" - }, - "source": "https://base-empreinte.ademe.fr/documentation/base-carbone?docLink=Repas" + "synonyms": ["viande"], + "slug": "boeuf", + "category": 2, + "Code_CIQUALs": [6001, 6103, 40202, 6212, 6002, 6140], + "ecv": [ + { + "id": 30, + "value": 153.307501 + }, + { + "id": 31, + "value": 0.5302016589999999 + }, + { + "id": 32, + "value": 1.789507 + }, + { + "id": 33, + "value": 1.3093690800000002 + }, + { + "id": 34, + "value": 0.24280017600000003 + }, + { + "id": 35, + "value": 0.2040811336 + } + ] + }, + { + "synonyms": ["viande"], + "slug": "veau", + "category": 2, + "Code_CIQUALs": [40304, 6560, 6521, 6510, 6540, 6522], + "ecv": [ + { + "id": 30, + "value": 102.45065899999999 + }, + { + "id": 31, + "value": 0.439934469 + }, + { + "id": 32, + "value": 1.789507 + }, + { + "id": 33, + "value": 1.30211159 + }, + { + "id": 34, + "value": 0.24280017600000003 + }, + { + "id": 35, + "value": 0.2040811336 + } + ] + }, + { + "synonyms": ["viande"], + "slug": "porc", + "category": 2, + "Code_CIQUALs": [28100, 28001, 28302, 28002], + "ecv": [ + { + "id": 30, + "value": 32.3075882 + }, + { + "id": 31, + "value": 3.3947620900000004 + }, + { + "id": 32, + "value": 1.7782722 + }, + { + "id": 33, + "value": 0.89418903 + }, + { + "id": 34, + "value": 0.15875396100000003 + }, + { + "id": 35, + "value": 0.1087142647 + } + ] + }, + { + "synonyms": ["viande"], + "slug": "canard", + "category": 2, + "Code_CIQUAL": 36201, + "ecv": [ + { + "id": 30, + "value": 5.1759893 + }, + { + "id": 31, + "value": 1.028726 + }, + { + "id": 32, + "value": 0.34413596 + }, + { + "id": 33, + "value": 0.29060694 + }, + { + "id": 34, + "value": 0.046692342 + }, + { + "id": 35, + "value": 0.088693171 + } + ] + }, + { + "synonyms": ["viande"], + "slug": "lapin", + "category": 2, + "Code_CIQUAL": 34001, + "ecv": [ + { + "id": 30, + "value": 5.1759893 + }, + { + "id": 31, + "value": 1.028726 + }, + { + "id": 32, + "value": 0.34413596 + }, + { + "id": 33, + "value": 0.29060694 + }, + { + "id": 34, + "value": 0.046692342 + }, + { + "id": 35, + "value": 0.088693171 + } + ] + }, + { + "synonyms": ["viande"], + "slug": "poulet", + "category": 2, + "Code_CIQUAL": 36003, + "ecv": [ + { + "id": 30, + "value": 4.1407915 + }, + { + "id": 31, + "value": 0.82298078 + }, + { + "id": 32, + "value": 0.27530877 + }, + { + "id": 33, + "value": 0.23248555 + }, + { + "id": 34, + "value": 0.037353873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["fruit de mer"], + "slug": "crevettes", + "category": 2, + "Code_CIQUAL": 10021, + "ecv": [ + { + "id": 30, + "value": 19.566057 + }, + { + "id": 32, + "value": 0.61179727 + }, + { + "id": 33, + "value": 1.1199623 + }, + { + "id": 34, + "value": 0.083008607 + }, + { + "id": 35, + "value": 0.40765779 + } + ] + }, + { + "synonyms": ["fruit de mer"], + "slug": "moules", + "category": 2, + "Code_CIQUAL": 10026, + "ecv": [ + { + "id": 30, + "value": 1.8266391 + }, + { + "id": 32, + "value": 1.1012351 + }, + { + "id": 33, + "value": 0.86809444 + }, + { + "id": 34, + "value": 0.14941549 + }, + { + "id": 35, + "value": 0.99090738 + } + ] + }, + { + "synonyms": ["fruit de mer"], + "slug": "huitres", + "category": 2, + "Code_CIQUAL": 10035, + "ecv": [ + { + "id": 30, + "value": 1.8266391 + }, + { + "id": 32, + "value": 1.075372 + }, + { + "id": 33, + "value": 0.86809444 + }, + { + "id": 34, + "value": 0.14941549 + }, + { + "id": 35, + "value": 0.99090738 + } + ] + }, + { + "synonyms": ["poisson"], + "slug": "cabillaud", + "category": 2, + "Code_CIQUAL": 26043, + "ecv": [ + { + "id": 30, + "value": 9.3213296 + }, + { + "id": 32, + "value": 0.27530877 + }, + { + "id": 33, + "value": 1.1705297 + }, + { + "id": 34, + "value": 0.037353873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["poisson"], + "slug": "lieu", + "category": 2, + "Code_CIQUAL": 26129, + "ecv": [ + { + "id": 30, + "value": 9.3213296 + }, + { + "id": 32, + "value": 0.27530877 + }, + { + "id": 33, + "value": 1.1705297 + }, + { + "id": 34, + "value": 0.037353873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["poisson"], + "slug": "dorade", + "category": 2, + "total": 10.8 + }, + { + "synonyms": ["poisson"], + "slug": "saumon", + "category": 2, + "Code_CIQUAL": 26036, + "ecv": [ + { + "id": 30, + "value": 4.6361406 + }, + { + "id": 31, + "value": 0.028729551 + }, + { + "id": 32, + "value": 0.27530877 + }, + { + "id": 33, + "value": 0.7821989 + }, + { + "id": 34, + "value": 0.037353873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["poisson"], + "slug": "thon", + "category": 2, + "Code_CIQUAL": 26053, + "ecv": [ + { + "id": 30, + "value": 3.2822136 + }, + { + "id": 32, + "value": 0.27530877 + }, + { + "id": 33, + "value": 0.78496269 + }, + { + "id": 34, + "value": 0.037353873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["poisson"], + "slug": "sardines", + "category": 2, + "Code_CIQUAL": 26065, + "ecv": [ + { + "id": 30, + "value": 0.70785437 + }, + { + "id": 32, + "value": 0.27530877 + }, + { + "id": 33, + "value": 0.90277484 + }, + { + "id": 34, + "value": 0.037353873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["produit laitier"], + "slug": "beurre", + "category": 2, + "Code_CIQUALs": [16400, 16402], + "ecv": [ + { + "id": 30, + "value": 14.4958395 + }, + { + "id": 31, + "value": 0.10604631 + }, + { + "id": 32, + "value": 0.36063324 + }, + { + "id": 33, + "value": 0.46471167 + }, + { + "id": 34, + "value": 0.07893572 + }, + { + "id": 35, + "value": 0.0133473958 + } + ] + }, + { + "synonyms": ["produit laitier"], + "slug": "fromagedure", + "category": 2, + "Code_CIQUALs": [12115, 12114, 12110, 12736], + "ecv": [ + { + "id": 30, + "value": 20.7993106 + }, + { + "id": 31, + "value": 1.56650109 + }, + { + "id": 32, + "value": 1.04933076 + }, + { + "id": 33, + "value": 0.84401292 + }, + { + "id": 34, + "value": 0.143879492 + }, + { + "id": 35, + "value": 0.0266947916 + } + ] + }, + { + "synonyms": ["produit laitier", "fromage"], + "slug": "feta", + "category": 2, + "Code_CIQUAL": 12061, + "ecv": [ + { + "id": 30, + "value": 4.6819877 + }, + { + "id": 31, + "value": 0.29382052 + }, + { + "id": 32, + "value": 0.26233269 + }, + { + "id": 33, + "value": 0.21100323 + }, + { + "id": 34, + "value": 0.035969873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["produit laitier"], + "slug": "fromagemolle", + "category": 2, + "Code_CIQUALs": [12001, 12021, 12030, 12051], + "ecv": [ + { + "id": 30, + "value": 17.6545436 + }, + { + "id": 31, + "value": 1.04670939 + }, + { + "id": 32, + "value": 1.04933076 + }, + { + "id": 33, + "value": 0.84401292 + }, + { + "id": 34, + "value": 0.143879492 + }, + { + "id": 35, + "value": 0.0266947916 + } + ] + }, + { + "synonyms": ["produit laitier", "fromage"], + "slug": "mozarella", + "category": 2, + "Code_CIQUAL": 19590, + "ecv": [ + { + "id": 30, + "value": 3.8001999 + }, + { + "id": 31, + "value": 0.29688809 + }, + { + "id": 32, + "value": 0.26233269 + }, + { + "id": 33, + "value": 0.21100323 + }, + { + "id": 34, + "value": 0.035969873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["produit laitier"], + "slug": "fromagebleu", + "category": 2, + "Code_CIQUALs": [12500, 12521, 12524], + "ecv": [ + { + "id": 30, + "value": 14.310749099999999 + }, + { + "id": 31, + "value": 0.80309092 + }, + { + "id": 32, + "value": 0.62296593 + }, + { + "id": 33, + "value": 0.6330096900000001 + }, + { + "id": 34, + "value": 0.107909619 + }, + { + "id": 35, + "value": 0.0200210937 + } + ] + }, + { + "slug": "oeuf", + "category": 2, + "Code_CIQUAL": 22000, + "ecv": [ + { + "id": 30, + "value": 2.7858188 + }, + { + "id": 32, + "value": 0.12481309 + }, + { + "id": 33, + "value": 0.16886546 + }, + { + "id": 34, + "value": 0.0084079787 + }, + { + "id": 35, + "value": 0.080351049 + } + ] + }, + { + "synonyms": ["margarine"], + "slug": "matieregrasse", + "category": 2, + "Code_CIQUAL": 16615, + "ecv": [ + { + "id": 30, + "value": 0.54310684 + }, + { + "id": 31, + "value": 1.010014 + }, + { + "id": 32, + "value": 0.18031662 + }, + { + "id": 33, + "value": 0.36047445 + }, + { + "id": 34, + "value": 0.037461758 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["produit laitier"], + "slug": "yaourt", + "category": 2, + "Code_CIQUAL": 19860, + "ecv": [ + { + "id": 30, + "value": 1.5332605 + }, + { + "id": 31, + "value": 0.14982272 + }, + { + "id": 32, + "value": 0.18031662 + }, + { + "id": 33, + "value": 0.20131239 + }, + { + "id": 34, + "value": 0.035969873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "synonyms": ["produit laitier"], + "slug": "fromageblanc", + "category": 2, + "Code_CIQUAL": 19644, + "ecv": [ + { + "id": 30, + "value": 1.0627205 + }, + { + "id": 31, + "value": 0.12902031 + }, + { + "id": 32, + "value": 0.18031662 + }, + { + "id": 33, + "value": 0.18373556 + }, + { + "id": 34, + "value": 0.035969873 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "slug": "laitdevache", + "category": 3, + "total": 1.33 + }, + { + "synonyms": ["céréales"], + "slug": "quinoa", + "category": 2, + "Code_CIQUAL": 9340, + "Code_AGB": "9340_2", + "ecv": [ + { + "id": 30, + "value": 7.2248763 + }, + { + "id": 31, + "value": 0.054581486 + }, + { + "id": 32, + "value": 0.26506589 + }, + { + "id": 33, + "value": 0.11784259 + }, + { + "id": 34, + "value": 0.01606076 + } + ] + }, + { + "synonyms": ["céréales"], + "slug": "riz", + "category": 2, + "Code_CIQUALs": [9100, 9102, 9109, 9108], + "ecv": [ + { + "id": 30, + "value": 8.6243924 + }, + { + "id": 32, + "value": 1.06026356 + }, + { + "id": 33, + "value": 1.25743044 + }, + { + "id": 34, + "value": 0.075106084 + } + ] + }, + { + "synonyms": ["céréales"], + "slug": "pates", + "category": 2, + "Code_CIQUAL": 9810, + "ecv": [ + { + "id": 30, + "value": 0.74798688 + }, + { + "id": 31, + "value": 0.95677951 + }, + { + "id": 32, + "value": 0.28118162 + }, + { + "id": 33, + "value": 0.1395071 + }, + { + "id": 34, + "value": 0.019438334 + } + ] + }, + { + "synonyms": ["céréales"], + "slug": "ble", + "category": 2, + "Code_CIQUALs": [9060, 9080, 9010], + "ecv": [ + { + "id": 30, + "value": 1.95235008 + }, + { + "id": 32, + "value": 0.7951976700000001 + }, + { + "id": 33, + "value": 0.39338607 + }, + { + "id": 34, + "value": 0.04818228 + } + ] + }, + { + "synonyms": ["céréales"], + "slug": "boulgour", + "category": 2, + "Code_CIQUAL": 9690, + "ecv": [ + { + "id": 30, + "value": 0.73765151 + }, + { + "id": 32, + "value": 0.26506589 + }, + { + "id": 33, + "value": 0.13112869 + }, + { + "id": 34, + "value": 0.01606076 + } + ] + }, + { + "slug": "poischiches", + "category": 2, + "Code_CIQUAL": 20516, + "ecv": [ + { + "id": 30, + "value": 0.3913532 + }, + { + "id": 32, + "value": 0.26506589 + }, + { + "id": 33, + "value": 0.26649669 + }, + { + "id": 34, + "value": 0.064800225 + } + ] + }, + { + "slug": "haricotsrouges", + "category": 2, + "Code_CIQUAL": 20525, + "ecv": [ + { + "id": 30, + "value": 0.4883118699999999 + }, + { + "id": 32, + "value": 0.26506589 + }, + { + "id": 33, + "value": 0.13112869 + }, + { + "id": 34, + "value": 0.064800225 + } + ] + }, + { + "slug": "lentilles", + "category": 2, + "Code_CIQUAL": 20521, + "ecv": [ + { + "id": 30, + "value": 0.39139233 + }, + { + "id": 32, + "value": 0.26506589 + }, + { + "id": 33, + "value": 0.18671623 + }, + { + "id": 34, + "value": 0.064800225 + } + ] + }, + { + "slug": "mais", + "category": 9, + "Code_CIQUAL": 9200, + "ecv": [ + { + "id": 30, + "value": 0.39438298 + }, + { + "id": 32, + "value": 0.26506589 + }, + { + "id": 33, + "value": 0.13112869 + }, + { + "id": 34, + "value": 0.019908241 + } + ] + }, + { + "slug": "cheeseburger", + "category": 2, + "Code_CIQUAL": 25414, + "ecv": [ + { + "id": 30, + "value": 16.341624 + }, + { + "id": 31, + "value": 0.32312121 + }, + { + "id": 32, + "value": 0.27732452 + }, + { + "id": 33, + "value": 0.21174859 + }, + { + "id": 34, + "value": 0.037768033 + }, + { + "id": 35, + "value": 0.092564276 + } + ] + }, + { + "slug": "kebab", + "category": 2, + "Code_CIQUAL": 25429, + "ecv": [ + { + "id": 30, + "value": 10.917579 + }, + { + "id": 31, + "value": 0.22521755 + }, + { + "id": 32, + "value": 0.27085217 + }, + { + "id": 33, + "value": 0.2106749 + }, + { + "id": 34, + "value": 0.037768033 + }, + { + "id": 35, + "value": 0.0066736979 + } + ] + }, + { + "slug": "burgerpoulet", + "category": 2, + "Code_CIQUAL": 25502, + "ecv": [ + { + "id": 30, + "value": 1.95235008 + }, + { + "id": 32, + "value": 0.7951976700000001 + }, + { + "id": 33, + "value": 0.39338607 + }, + { + "id": 34, + "value": 0.04818228 + } + ] + }, + { + "slug": "pizza", + "category": 2, + "Code_CIQUAL": 25478, + "ecv": [ + { + "id": 30, + "value": 2.514726 + }, + { + "id": 31, + "value": 0.30314054 + }, + { + "id": 32, + "value": 0.10407185 + }, + { + "id": 33, + "value": 0.22488013 + }, + { + "id": 34, + "value": 0.037768033 + }, + { + "id": 35, + "value": 0.092564276 + } + ] + }, + { + "slug": "sushis", + "category": 2, + "Code_CIQUAL": 25456, + "ecv": [ + { + "id": 30, + "value": 1.8128867 + }, + { + "id": 31, + "value": 0.031970205 + }, + { + "id": 32, + "value": 0.21032583 + }, + { + "id": 33, + "value": 0.34340928 + }, + { + "id": 34, + "value": 0.037768033 + }, + { + "id": 35, + "value": 0.017696322 + } + ] + }, + { + "slug": "burgervegetarien", + "category": 2, + "Code_CIQUAL": 25415, + "Code_AGB": "25415_2", + "ecv": [ + { + "id": 30, + "value": 1.1099088 + }, + { + "id": 31, + "value": 0.55318135 + }, + { + "id": 32, + "value": 0.27841232 + }, + { + "id": 33, + "value": 0.18611522 + }, + { + "id": 34, + "value": 0.037768832 + }, + { + "id": 35, + "value": 0.092564276 + } + ] + }, + { + "slug": "frites", + "category": 2, + "Code_CIQUAL": 4032, + "ecv": [ + { + "id": 30, + "value": 0.23301609 + }, + { + "id": 31, + "value": 0.25794215 + }, + { + "id": 32, + "value": 0.40034907 + }, + { + "id": 33, + "value": 0.36114825 + }, + { + "id": 34, + "value": 0.15356021 + }, + { + "id": 35, + "value": 0.12184437 + } + ] + }, + { + "slug": "tofu", + "category": 2, + "Code_CIQUAL": 20904, + "ecv": [ + { + "id": 30, + "value": 0.083115821 + }, + { + "id": 31, + "value": 0.1454799 + }, + { + "id": 32, + "value": 0.18549789 + }, + { + "id": 33, + "value": 0.19497818 + }, + { + "id": 34, + "value": 0.037768033 + }, + { + "id": 35, + "value": 0.017696322 + } + ] + }, + { + "slug": "boucheechocolat", + "category": 2, + "Code_CIQUAL": 31066, + "ecv": [ + { + "id": 30, + "value": 8.5822707 + }, + { + "id": 31, + "value": 0.57571437 + }, + { + "id": 32, + "value": 0.10402936 + }, + { + "id": 33, + "value": 0.31376547 + }, + { + "id": 34, + "value": 0.017263204 + } + ] + }, + { + "slug": "pateatartiner", + "category": 2, + "Code_CIQUAL": 31032, + "ecv": [ + { + "id": 30, + "value": 6.8500101 + }, + { + "id": 31, + "value": 0.3052603 + }, + { + "id": 32, + "value": 0.17071537 + }, + { + "id": 33, + "value": 0.22169116 + }, + { + "id": 34, + "value": 0.017263204 + } + ] + }, + { + "slug": "brownie", + "category": 2, + "Code_CIQUAL": 23032, + "ecv": [ + { + "id": 30, + "value": 6.3294106 + }, + { + "id": 31, + "value": 0.34862379 + }, + { + "id": 32, + "value": 0.287793 + }, + { + "id": 33, + "value": 0.20994214 + }, + { + "id": 34, + "value": 0.019437894 + } + ] + }, + { + "synonyms": ["patisserie", "chocolatine"], + "slug": "painauchocolat", + "category": 2, + "Code_CIQUAL": 7730, + "ecv": [ + { + "id": 30, + "value": 4.4157734 + }, + { + "id": 31, + "value": 0.25971159 + }, + { + "id": 32, + "value": 0.28784633 + }, + { + "id": 33, + "value": 0.17206993 + }, + { + "id": 34, + "value": 0.004786188 + } + ] + }, + { + "slug": "cookie", + "category": 2, + "Code_CIQUAL": 24684, + "ecv": [ + { + "id": 30, + "value": 3.1816353 + }, + { + "id": 31, + "value": 0.54086276 + }, + { + "id": 32, + "value": 0.10984827 + }, + { + "id": 33, + "value": 0.21088666 + }, + { + "id": 34, + "value": 0.019437894 + } + ] + }, + { + "slug": "madeleine", + "category": 2, + "Code_CIQUALs": [24632, 24630], + "ecv": [ + { + "id": 30, + "value": 3.73293361 + }, + { + "id": 31, + "value": 0.68339431 + }, + { + "id": 32, + "value": 0.57566289 + }, + { + "id": 33, + "value": 0.29605526000000004 + }, + { + "id": 34, + "value": 0.038875788 + } + ] + }, + { + "synonyms": ["patisserie"], + "slug": "painauxraisins", + "category": 2, + "Code_CIQUAL": 7720, + "ecv": [ + { + "id": 30, + "value": 2.0148568 + }, + { + "id": 31, + "value": 0.19315803 + }, + { + "id": 32, + "value": 0.28784046 + }, + { + "id": 33, + "value": 0.13034297 + }, + { + "id": 34, + "value": 0.004786188 + } + ] + }, + { + "synonyms": ["patisserie"], + "slug": "chaussonauxpommes", + "category": 2, + "Code_CIQUAL": 23480, + "ecv": [ + { + "id": 30, + "value": 1.5090815 + }, + { + "id": 31, + "value": 0.19422198 + }, + { + "id": 32, + "value": 0.28780692 + }, + { + "id": 33, + "value": 0.13772821 + }, + { + "id": 34, + "value": 0.004786188 + } + ] + }, + { + "synonyms": ["patisserie"], + "slug": "croissant", + "category": 2, + "Code_CIQUAL": 7620, + "ecv": [ + { + "id": 30, + "value": 1.9944296 + }, + { + "id": 31, + "value": 0.18765296 + }, + { + "id": 32, + "value": 0.28784654 + }, + { + "id": 33, + "value": 0.12601649 + }, + { + "id": 34, + "value": 0.004786188 + } + ] + }, + { + "slug": "paindemie", + "category": 2, + "Code_CIQUAL": 7200, + "ecv": [ + { + "id": 30, + "value": 1.0360508 + }, + { + "id": 31, + "value": 0.31350489 + }, + { + "id": 32, + "value": 0.28130214 + }, + { + "id": 33, + "value": 0.1177356 + }, + { + "id": 34, + "value": 0.004786188 + } + ] + }, + { + "slug": "bonbons", + "category": 2, + "Code_CIQUAL": 31060, + "ecv": [ + { + "id": 30, + "value": 0.57192017 + }, + { + "id": 31, + "value": 0.59527116 + }, + { + "id": 32, + "value": 0.18551167 + }, + { + "id": 33, + "value": 0.18709575 + }, + { + "id": 34, + "value": 0.017263204 + } + ] + }, + { + "slug": "baguette", + "category": 2, + "Code_CIQUAL": 7001, + "ecv": [ + { + "id": 30, + "value": 0.38312009 + }, + { + "id": 31, + "value": 0.17820109 + }, + { + "id": 32, + "value": 0.013430369 + }, + { + "id": 33, + "value": 0.10712652 + }, + { + "id": 34, + "value": 0.004786188 + } + ] + }, + { + "slug": "pomme", + "category": 9, + "total": 0.396 + }, + { + "slug": "carotte", + "category": 9, + "total": 0.364 + }, + { + "slug": "courgette", + "category": 9, + "total": 0.484 + }, + { + "slug": "tomate", + "category": 9, + "total": 0.582 + }, + { + "slug": "potiron", + "category": 9, + "total": 0.619 + }, + { + "slug": "laitue", + "category": 9, + "total": 0.941 + }, + { + "slug": "banane", + "category": 9, + "total": 0.881 + }, + { + "slug": "mangue", + "category": 9, + "total": 10.642 + }, + { + "slug": "poireau", + "category": 9, + "total": 0.769 + }, + { + "slug": "avocat", + "category": 9, + "total": 1.48 + }, + { + "slug": "pommedeterre", + "category": 2, + "total": 0.37 } ] diff --git a/src/data/categories/repas.json b/src/data/categories/repas.json new file mode 100644 index 000000000..d4aaea206 --- /dev/null +++ b/src/data/categories/repas.json @@ -0,0 +1,89 @@ +[ + { + "id": 20689, + "name": "Repas avec du boeuf", + "synonyms": ["manger", "alimenter", "viande"], + "slug": "repasavecduboeuf", + "category": 2, + "total": 7.26, + "default": true, + "tile": true, + "meta": { + "title": "Repas boeuf", + "description": "Un repas avec du boeuf a un impact important sur le climat. Mesurez votre impact en découvrant la valeur en CO₂e de votre repas" + }, + "source": "https://base-empreinte.ademe.fr/documentation/base-carbone?docLink=Repas" + }, + { + "id": 20683, + "name": "Repas végétarien[s]", + "synonyms": ["manger", "alimenter"], + "slug": "repasvegetarien", + "category": 2, + "total": 0.51, + "default": true, + "tile": true, + "meta": { + "title": "Repas végétarien", + "description": "Un repas avec du boeuf, un repas avec du poulet, ou un repas végétarien aura un impact différent sur le climat. Quel est l'impact d'un repas végétarien ?" + }, + "source": "https://base-empreinte.ademe.fr/documentation/base-carbone?docLink=Repas" + }, + { + "name": "Repas végétalien[s]", + "synonyms": ["manger", "alimenter"], + "slug": "repasvegetalien", + "category": 2, + "total": 0.39, + "default": true, + "tile": false, + "meta": { + "title": "Repas végétalien", + "description": "Découvrez l'impact climat d'un repas végétalien et comparez-le à l'impact climat d'un repas avec du boeuf ou avec du poulet" + }, + "source": "https://nosgestesclimat.fr/documentation/alimentation/plats/v%C3%A9g%C3%A9talien/empreinte" + }, + { + "name": "Repas avec du poisson blanc", + "synonyms": ["manger", "alimenter"], + "slug": "repasavecdupoissonblanc", + "category": 2, + "total": 1.98, + "default": true, + "tile": false, + "meta": { + "title": "Repas poisson blanc", + "description": "Découvrez la différence de l'impact climat entre un repas avec du poisson blanc et un repas avec de la viande. Mesurez votre empreinte carbone" + }, + "source": "https://nosgestesclimat.fr/documentation/alimentation/plats/poisson-2/empreinte" + }, + { + "name": "Repas avec du poisson gras", + "synonyms": ["manger", "alimenter"], + "slug": "repasavecdupoissongras", + "category": 2, + "total": 1.11, + "default": true, + "tile": false, + "meta": { + "title": "Repas poisson gras", + "description": "Voici l'impact émis par repas avec du poisson gras comprenant la fabrication, la distribution et la consommation" + }, + "source": "https://nosgestesclimat.fr/documentation/alimentation/plats/poisson-1/empreinte" + }, + { + "id": 20688, + "name": "Repas avec du poulet", + "synonyms": ["manger", "alimenter", "viande"], + "slug": "repasavecdupoulet", + "category": 2, + "total": 1.58, + "default": true, + "tile": false, + "meta": { + "title": "Repas poulet", + "description": "Quelle est la différence sur le climat entre un repas avec du poulet, un repas avec du boeuf, ou un repas végétarien ? Mesurez votre impact sur le climat" + }, + "source": "https://base-empreinte.ademe.fr/documentation/base-carbone?docLink=Repas" + } +] diff --git a/src/providers/locales/en.json b/src/providers/locales/en.json index 159b4b8c0..e51994356 100644 --- a/src/providers/locales/en.json +++ b/src/providers/locales/en.json @@ -398,6 +398,7 @@ "stockagedonnee": "For 1 year.", "boeuf": "Average of emission factors for rib steak, entrecôte, beef tongue, flank steak, beef shoulder, beef cheek", "veau": "Average of emission factors for veal rib, veal shoulder, veal escalope, veal nut, veal breast, and veal sweetbread", + "porc": "Average of emission factors for pork chop, pork shoulder, pork belly, pork loin", "dorade": "Average of emission factors for farmed gilthead seabream and wild gilthead seabream", "beurre": "Average of emission factors for unsalted butter and salted butter", "fromagedure": "Average of emission factors for various hard cheeses: Emmental, Gruyère, Comté, Gouda, etc.", diff --git a/src/providers/locales/es.json b/src/providers/locales/es.json index 6f3c81eb8..bdc24e83e 100644 --- a/src/providers/locales/es.json +++ b/src/providers/locales/es.json @@ -398,6 +398,7 @@ "stockagedonnee": "Durante 1 año.", "boeuf": "Promedio de los factores de emisión de costilla de res, entrecot, lengua de res, bistec de falda, paleta de res, carrillera de res", "veau": "Promedio de los factores de emisión de costilla de ternera, paleta de ternera, escalope de ternera, nuez de ternera, pecho de ternera y molleja de ternera", + "porc": "Promedio de los factores de emisión de chuleta de cerdo, paleta de cerdo, panceta de cerdo, lomo de cerdo", "dorade": "Promedio de los factores de emisión de dorada de cultivo y dorada salvaje", "beurre": "Promedio de los factores de emisión de mantequilla sin sal y mantequilla con sal", "fromagedure": "Promedio de los factores de emisión de varios quesos duros: Emmental, Gruyère, Comté, Gouda, etc.", diff --git a/src/providers/locales/fr.json b/src/providers/locales/fr.json index c7b3dff71..876585f74 100644 --- a/src/providers/locales/fr.json +++ b/src/providers/locales/fr.json @@ -398,6 +398,7 @@ "stockagedonnee": "Pendant 1 an.", "boeuf": "Moyenne des facteurs d’émission de la côte de boeuf, l’entrecôte, la langue de boeuf, la bavette, l’épaule de boeuf, la joue de boeuf", "veau": "Moyenne des facteurs d’émission de la côte de veau, épaule de veau, escalope de veau, noix de veau, poitrine de veau et riz de veau", + "porc": "Moyenne des facteurs d’émission de la côte de porc, échine de porc, poitrine de porc, épaule de porc", "dorade": "Moyenne des facteurs d’émission de la dorade royale d’élevage et la dorade royale sauvage", "beurre": "Moyenne des facteurs d’émission du beurre doux et beurre salé", "fromagedure": "Moyenne des facteurs d’émission des différents fromages à pâte dure : Emmental, gruyère, comté, gouda etc.", diff --git a/src/scripts/buildFromAgribalyse.ts b/src/scripts/buildFromAgribalyse.ts index 56d1d9512..b63964198 100644 --- a/src/scripts/buildFromAgribalyse.ts +++ b/src/scripts/buildFromAgribalyse.ts @@ -1,5 +1,6 @@ import axios from 'axios' import fs from 'fs' +import alimentation from '../data/categories/alimentation.json' import boissons from '../data/categories/boisson.json' import fruitsetlegumes from '../data/categories/fruitsetlegumes.json' import { BoissonEquivalent, EquivalentValue, FruitsEtLegumesEquivalent } from '../../types/equivalent' @@ -14,6 +15,7 @@ const existingEquivalentsByCategory: Record< > = { boissons: { file: 'boisson.json', values: boissons }, fruitsetlegumes: { file: 'fruitsetlegumes.json', values: fruitsetlegumes }, + alimentation: { file: 'alimentation.json', values: alimentation }, } const finalitiesId: Record = { @@ -34,10 +36,14 @@ const agrybaliseValues = [ const updateEquivalents = ( equivalents: (BoissonEquivalent | FruitsEtLegumesEquivalent)[], - values: (Record & { Code_CIQUAL: number; Code_AGB?: string; "Sous-groupe_d'aliment": string })[] + values: (Record & { + Code_CIQUAL: number + Code_AGB?: string + "Sous-groupe_d'aliment": string + })[] ) => { return equivalents.map((equivalent) => { - if (!('Code_CIQUAL' in equivalent)) { + if (!('Code_CIQUAL' in equivalent) && !('Code_CIQUALs' in equivalent)) { return equivalent } @@ -45,6 +51,22 @@ const updateEquivalents = ( const agbValue = values.find((v) => v.Code_AGB === equivalent.Code_AGB) if (agbValue) { value = agbValue + } else if ('Code_CIQUALs' in equivalent && equivalent.Code_CIQUALs) { + console.log(equivalent.Code_CIQUALs) + + const ciqualValues = values.filter((v) => equivalent.Code_CIQUALs?.includes(v.Code_CIQUAL)) + console.log(ciqualValues) + if (ciqualValues.length !== equivalent.Code_CIQUALs.length) { + throw new Error( + 'BUG! ' + equivalent.slug + ' has too much possible values, should use a Code_AGB to discriminate' + ) + } + Object.entries(finalitiesId).forEach(([finality]) => { + value[`${AgrybalisePrefixEnum.ChangementClimatique}${finality}`] = ciqualValues.reduce( + (acc, current) => acc + current[`${AgrybalisePrefixEnum.ChangementClimatique}${finality}`], + 0 + ) + }) } else { const ciqualValues = values.filter((v) => v.Code_CIQUAL === equivalent.Code_CIQUAL) if (ciqualValues.length === 1) { @@ -79,12 +101,18 @@ const updateEquivalents = ( const buildFromAgribalyse = async (key: string) => { const existingEquivalents = existingEquivalentsByCategory[key] if (!existingEquivalents) { - console.info('Type should be "boissons" or "fruitsetlegumes"') + console.info('Type should be "boissons", "alimentation" or "fruitsetlegumes"') process.exit(1) } const ciquals = existingEquivalents.values - .map((equivalent) => ('Code_CIQUAL' in equivalent ? equivalent.Code_CIQUAL : '')) + .flatMap((equivalent) => + 'Code_CIQUAL' in equivalent + ? [equivalent.Code_CIQUAL] + : 'Code_CIQUALs' in equivalent && equivalent.Code_CIQUALs + ? equivalent.Code_CIQUALs + : [] + ) .filter((code) => !!code) .join(',') const remote_url = encodeURI( @@ -103,4 +131,5 @@ if (process.argv[2]) { } else { buildFromAgribalyse('boissons') buildFromAgribalyse('fruitsetlegumes') + buildFromAgribalyse('alimentation') } diff --git a/src/scripts/buildFromEmpreinte.ts b/src/scripts/buildFromEmpreinte.ts index dbb7469ad..04b944521 100644 --- a/src/scripts/buildFromEmpreinte.ts +++ b/src/scripts/buildFromEmpreinte.ts @@ -1,18 +1,18 @@ import axios from 'axios' import fs from 'fs' -import alimentation from '../data/categories/alimentation.json' import deplacement from '../data/categories/deplacement.json' import electromenager from '../data/categories/electromenager.json' import habillement from '../data/categories/habillement.json' import mobilier from '../data/categories/mobilier.json' import numerique from '../data/categories/numerique.json' +import repas from '../data/categories/repas.json' import { UsableEquivalent } from '../../types/equivalent' const existingEquivalentsByCategory: Record = { electromenager: { file: 'electromenager.json', values: electromenager }, habillement: { file: 'habillement.json', values: habillement }, mobilier: { file: 'mobilier.json', values: mobilier }, - alimentation: { file: 'alimentation.json', values: alimentation }, + repas: { file: 'repas.json', values: repas }, numerique: { file: 'numerique.json', values: numerique }, } @@ -182,7 +182,7 @@ const buildFromEmpreinte = async (key: string) => { } const existingEquivalents = existingEquivalentsByCategory[key] if (!existingEquivalents || key === 'transport') { - console.info('Type should be "transport", "electomenager", "habillement", "mobilier" or "alimentation"') + console.info('Type should be "transport", "electomenager", "habillement", "mobilier" or "repas"') process.exit(1) } @@ -217,6 +217,6 @@ if (process.argv[2]) { buildFromEmpreinte('electromenager') buildFromEmpreinte('habillement') buildFromEmpreinte('mobilier') - buildFromEmpreinte('alimentation') + buildFromEmpreinte('repas') buildFromEmpreinte('transport') } diff --git a/types/equivalent.d.ts b/types/equivalent.d.ts index 0d0ff5b71..6245346eb 100644 --- a/types/equivalent.d.ts +++ b/types/equivalent.d.ts @@ -55,9 +55,10 @@ export type DeplacementEquivalent = BaseEquivalent & { export type BoissonEquivalent = BaseEquivalent & ( | { - Code_CIQUAL: number + Code_CIQUAL?: number Code_AGB?: string - ecv: EquivalentValue[] + Code_CIQUALs?: number[] + ecv?: EquivalentValue[] } | { total: number