@socialgouv/legi-data-types 2.181.0 → 2.183.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/README.md +25 -56
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,75 +9,44 @@
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
[
|
|
14
|
-
|
|
15
|
-
- [Usage](#usage)
|
|
16
|
-
- [Getting started](#getting-started)
|
|
17
|
-
- [Definitions](#definitions)
|
|
18
|
-
- [Code](#code)
|
|
19
|
-
- [Article](#article)
|
|
20
|
-
- [API](#api)
|
|
21
|
-
- [Data](#data)
|
|
22
|
-
- [getArticleWithParentSections()](#getarticlewithparentsections)
|
|
23
|
-
- [getCode()](#getcode)
|
|
24
|
-
- [getCodeWithParents()](#getcodewithparents)
|
|
25
|
-
- [getIndexedArticle()](#getindexedarticle)
|
|
26
|
-
- [getIndexedArticles()](#getindexedarticles)
|
|
27
|
-
- [getIndexedCodes()](#getindexedcodes)
|
|
28
|
-
- [hasArticle()](#hasarticle)
|
|
29
|
-
- [hasCode()](#hascode)
|
|
30
|
-
- [Contributing](#contributing)
|
|
31
|
-
- [Getting started](#getting-started-1)
|
|
32
|
-
- [Data Generation](#data-generation)
|
|
33
|
-
- [Tests](#tests)
|
|
34
|
-
- [References](#references)
|
|
35
|
-
- [Also](#also)
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
12
|
+
Extractions quotidiennes des codes de loi de la
|
|
13
|
+
[base LEGI](https://www.data.gouv.fr/fr/datasets/legi-codes-lois-et-reglements-consolides/) depuis
|
|
14
|
+
l'API legifrance.gouv.fr
|
|
38
15
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```sh
|
|
42
|
-
npm i @socialgouv/legi-data
|
|
43
|
-
# or if you only need the Typescript types
|
|
44
|
-
npm i -D @socialgouv/legi-data-types
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Definitions
|
|
48
|
-
|
|
49
|
-
#### Code
|
|
16
|
+
Les données sont disponibles au format JSON ou via une API TypeScript.
|
|
50
17
|
|
|
51
|
-
|
|
52
|
-
of articles wrapped within sections.
|
|
18
|
+
ex pour récupérer le "code du travail" complet :
|
|
53
19
|
|
|
54
|
-
|
|
20
|
+
```
|
|
21
|
+
const code = require("@socialgouv/legi-data/data/LEGITEXT000006072050.json");
|
|
22
|
+
```
|
|
55
23
|
|
|
56
|
-
|
|
24
|
+
La structure du JSON est basée sur [unified](https://unifiedjs.com/)
|
|
57
25
|
|
|
58
|
-
|
|
26
|
+
---
|
|
59
27
|
|
|
60
|
-
|
|
28
|
+
Actuellement, seuls 4 codes sont versionnés ici :
|
|
61
29
|
|
|
62
|
-
|
|
30
|
+
| Id | Description |
|
|
31
|
+
| -------------------- | ------------------------------------------------------ |
|
|
32
|
+
| LEGITEXT000006072050 | Code du travail |
|
|
33
|
+
| LEGITEXT000022197698 | Code de la sécurité sociale |
|
|
34
|
+
| LEGITEXT000022197698 | Code rural et de la pêche maritime |
|
|
35
|
+
| LEGITEXT000031366350 | Code des relations entre le public et l'administration |
|
|
63
36
|
|
|
64
|
-
|
|
65
|
-
tree straight from the data directory:
|
|
37
|
+
Postez [une issue](https://github.com/SocialGouv/legi-data) si vous souhaitez en voir d'autres.
|
|
66
38
|
|
|
67
|
-
|
|
68
|
-
const LaborCode = require("@socialgouv/legi-data/data/LEGITEXT000006072050.json");
|
|
69
|
-
```
|
|
39
|
+
---
|
|
70
40
|
|
|
71
|
-
|
|
41
|
+
## API TypeScript
|
|
72
42
|
|
|
73
|
-
|
|
74
|
-
const codes = require("@socialgouv/legi-data/data/index.json");
|
|
75
|
-
```
|
|
43
|
+
### Getting started
|
|
76
44
|
|
|
77
|
-
|
|
45
|
+
```sh
|
|
46
|
+
npm i @socialgouv/legi-data
|
|
78
47
|
|
|
79
|
-
|
|
80
|
-
|
|
48
|
+
# or if you only need the Typescript types
|
|
49
|
+
npm i -D @socialgouv/legi-data-types
|
|
81
50
|
```
|
|
82
51
|
|
|
83
52
|
#### getArticleWithParentSections()
|