@incubateur-ademe/nosgestesclimat 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Datagir
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+
2
+ <div align="center">
3
+ <h3 align="center">
4
+ <big>Nos Gestes Climat</big>
5
+ </h3>
6
+ <p align="center">
7
+ <a href="https://github.com/incubateur-ademe/nosgestesclimat/issues">Report Bug</a>
8
+
9
+ <a href="https://nogestesclimat.fr">nosgestesclimat.fr</a>
10
+
11
+ <a href="https://github.com/incubateur-ademe/nosgestesclimat-site-nextjs">Code du site</a>
12
+ </p>
13
+
14
+ <!-- ![CI][ci-link] ![NPM][npm-link] -->
15
+ Modèle de calcul de l'empreinte climat personnelle.
16
+
17
+ </div>
18
+
19
+ ## Utilisation
20
+
21
+ Vous pouvez parcourir le modèle grâce à ça [documentation en
22
+ ligne](https://nosgestesclimat.fr/documentation) ou bien utiliser le paquet npm
23
+ `@incubateur-ademe/nosgestesclimat` :
24
+
25
+ ```sh
26
+ yarn add @incubateur-ademe/nosgestesclimat
27
+ ```
28
+
29
+ ```ts
30
+ import { rules } from "@incubateur-ademe/nosgestesclimat";
31
+ import Engine from "publicodes";
32
+
33
+ const engine = new Engine(rules);
34
+ console.log(engine.evaluate("bilan"))
35
+ ```
36
+
37
+ ## Écriture des modèles du simulateur
38
+
39
+ Le modèle d'empreinte climat personnelle est écrit dans un français le plus
40
+ lisible possible :
41
+
42
+ ```yaml
43
+ # Premier extrait
44
+ douche . litres par minute:
45
+ unité: l/minute
46
+ formule:
47
+ variations:
48
+ - si: pomme de douche économe
49
+ alors: 9
50
+ - sinon: 18
51
+
52
+ # Deuxième extrait
53
+ transport . avion . coefficient de forçage radiatif:
54
+ description: >
55
+ Le forçage radiatif, c'est la capacité d'une émission de gaz à rechauffer la
56
+ terre.
57
+ Un vol émet du CO₂, mais aussi d'autres gaz, ainsi que de la vapeur libérée en haute altitude. Le forçage radiatif de ces émissions est conséquent et doit donc être pris en compte, mais c'est une estimation très compliquée.
58
+ L'effet de la vapeur d'eau est temporaire : elle disparaît à court-terme par rapport au CO₂ qui reste très longtemps présent. Son effet n'en reste pas moins massif.
59
+ formule: 2
60
+ note: |
61
+ Plus d'informations ici:
62
+ - https://www.carbonindependent.org/sources_aviation.html
63
+ - http://www.bilans-ges.ademe.fr/forum/viewtopic.php?f=20&t=4009&sid=dea7e08c81c2f723b803d27e7e2a8797
64
+ - https://fr.wikipedia.org/wiki/Impact_climatique_du_transport_a%C3%A9rien#Pond%C3%A9ration_des_%C3%A9missions
65
+ ```
66
+
67
+ :pen: Suivez [le guide pour
68
+ contribuer](https://github.com/incubateur-ademe/nosgestesclimat/blob/master/CONTRIBUTING.md).
69
+
70
+ Tous les modèles sont dans [le dossier
71
+ `data`](https://github.com/incubateur-ademe/nosgestesclimat/tree/master/data).
72
+
73
+ Ils reposent sur le nouveau langage de programmation
74
+ [`publicodes`](https://publi.codes) et développé dans le cadre de
75
+ https://beta.gouv.fr.