@tricoteuses/assemblee 2.5.30 → 3.0.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.md +16 -6
- package/README.md +2 -19
- package/lib/amendements-CXmsqoof.js +170 -0
- package/lib/amendements-CZHXlq07.js +4198 -0
- package/lib/cleaners/acteurs.d.ts +2 -1
- package/lib/cleaners/amendements.d.ts +2 -1
- package/lib/cleaners/debats.d.ts +2 -1
- package/lib/cleaners/documents.d.ts +2 -1
- package/lib/cleaners/dossiers_legislatifs.d.ts +2 -1
- package/lib/cleaners/organes.d.ts +2 -1
- package/lib/cleaners/questions.d.ts +2 -1
- package/lib/cleaners/reunions.d.ts +2 -1
- package/lib/cleaners/scrutins.d.ts +2 -1
- package/lib/cleaners/xml.d.ts +5 -5
- package/lib/cleaners.js +186 -179
- package/lib/datasets.d.ts +5 -7
- package/lib/dossiers_legislatifs.d.ts +5 -2
- package/lib/file_systems.d.ts +10 -3
- package/lib/index.d.ts +24 -19
- package/lib/index.js +390 -1234
- package/lib/inserters.d.ts +466 -9
- package/lib/loaders.d.ts +13 -12
- package/lib/loaders.js +1901 -538
- package/lib/organes.d.ts +1 -1
- package/lib/parsers/compte_rendu.d.ts +2 -1
- package/lib/parsers/compte_rendu_commission.d.ts +1 -1
- package/lib/parsers/recherche_amendements.d.ts +2 -2
- package/lib/parsers/textes_lois.d.ts +1 -1
- package/lib/parsers.js +2109 -2075
- package/lib/questions-DTO3nK5V.js +2777 -0
- package/lib/questions-DXAzvI1T.js +230 -0
- package/lib/registries.d.ts +112 -0
- package/lib/schemas/clean/acteurs_et_organes.d.ts +2377 -0
- package/lib/schemas/clean/agendas.d.ts +830 -0
- package/lib/schemas/clean/amendements.d.ts +2305 -0
- package/lib/schemas/clean/debats.d.ts +300 -0
- package/lib/schemas/clean/dossiers_legislatifs.d.ts +1365 -0
- package/lib/schemas/clean/questions.d.ts +625 -0
- package/lib/schemas/clean/scrutins.d.ts +1137 -0
- package/lib/schemas/enriched/acteurs_et_organes.d.ts +112 -0
- package/lib/schemas/enriched/agendas.d.ts +501 -0
- package/lib/schemas/enriched/amendements.d.ts +1230 -0
- package/lib/schemas/enriched/debats.d.ts +308 -0
- package/lib/schemas/enriched/dossiers_legislatifs.d.ts +1131 -0
- package/lib/schemas/enriched/questions.d.ts +589 -0
- package/lib/schemas/enriched/scrutins.d.ts +1094 -0
- package/lib/schemas/raw/acteurs_et_organes.d.ts +5870 -0
- package/lib/schemas/raw/agendas.d.ts +1734 -0
- package/lib/schemas/raw/amendements.d.ts +4758 -0
- package/lib/schemas/raw/debats.d.ts +410 -0
- package/lib/schemas/raw/dossiers_legislatifs.d.ts +3252 -0
- package/lib/schemas/raw/questions.d.ts +983 -0
- package/lib/schemas/raw/scrutins.d.ts +2763 -0
- package/lib/scripts/retrieve_deputes_photos.d.ts +58 -4
- package/lib/scripts/retrieve_documents.d.ts +86 -12
- package/lib/scripts/retrieve_open_data.d.ts +39 -4
- package/lib/scripts/retrieve_videos.d.ts +1 -1
- package/lib/scripts/shared/cli_helpers.d.ts +41 -77
- package/lib/scripts/shared/photos.d.ts +106 -0
- package/lib/scripts/shared/utils.d.ts +4 -0
- package/lib/urls.d.ts +2 -2
- package/package.json +16 -12
- package/lib/amendements-40Z7OJLT.js +0 -682
- package/lib/amendements-J6Sx61n8.js +0 -154
- package/lib/datasets-Cb3wpfRH.js +0 -3580
- package/lib/parse-Ccs6wcUg.js +0 -2512
- package/lib/raw_types/acteurs_et_organes.d.ts +0 -464
- package/lib/raw_types/agendas.d.ts +0 -265
- package/lib/raw_types/amendements.d.ts +0 -365
- package/lib/raw_types/debats.d.ts +0 -140
- package/lib/raw_types/dossiers_legislatifs.d.ts +0 -567
- package/lib/raw_types/questions.d.ts +0 -115
- package/lib/raw_types/scrutins.d.ts +0 -187
- package/lib/schemas/acteurs_et_organes.json +0 -1167
- package/lib/schemas/agendas.json +0 -1757
- package/lib/schemas/amendements.json +0 -2087
- package/lib/schemas/compte_rendu_commission/CompteRenduCommission.json +0 -63
- package/lib/schemas/debats.json +0 -847
- package/lib/schemas/dossiers_legislatifs.json +0 -3884
- package/lib/schemas/legislatures.json +0 -17
- package/lib/schemas/questions.json +0 -711
- package/lib/schemas/scrutins.json +0 -701
- package/lib/scripts/copy-schemas.d.ts +0 -1
- package/lib/scripts/generate-json-schemas.d.ts +0 -1
- package/lib/shared_types/acteurs_et_organes.d.ts +0 -149
- package/lib/shared_types/dossiers_legislatifs.d.ts +0 -222
- package/lib/types/acteurs_et_organes.d.ts +0 -598
- package/lib/types/agendas.d.ts +0 -442
- package/lib/types/amendements.d.ts +0 -615
- package/lib/types/debats.d.ts +0 -186
- package/lib/types/dossiers_legislatifs.d.ts +0 -826
- package/lib/types/questions.d.ts +0 -203
- package/lib/types/scrutins.d.ts +0 -254
- /package/lib/{types/legislatures.d.ts → legislatures.d.ts} +0 -0
package/LICENSE.md
CHANGED
|
@@ -3,14 +3,24 @@
|
|
|
3
3
|
## _Retrieve, clean up & handle French Assemblée nationale's open data_
|
|
4
4
|
|
|
5
5
|
By:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
- Henry Boisgibault <mailto:henry.boisgibault@proton.me>
|
|
8
|
+
- Jérémie Corpinot <mailto:jerem.freelance@codingbox.fr>
|
|
9
|
+
- Mathilde Couvreur <mailto:mathilde.couvreur@gmail.com>
|
|
10
|
+
- Loïc Dachary <mailto:loic@dachary.org>
|
|
11
|
+
- Pierre Drege <mailto:dregop@proton.me>
|
|
12
|
+
- Nelson Herbin <mailto:nelson@herbin.info>
|
|
13
|
+
- implicitdef
|
|
14
|
+
- Hélène Jonin <mailto:helene.jonin@gmail.com>
|
|
15
|
+
- Pauline Léon <mailto:paulineleon@tutanota.com>
|
|
16
|
+
- Paul-Henry Ngounou <mailto:ngpaulhenry@gmail.com>
|
|
17
|
+
- Emmanuel Raviart <mailto:emmanuel@raviart.com>
|
|
9
18
|
|
|
10
19
|
Copyright:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
|
|
21
|
+
- © 2019, 2020, 2021 Loïc Dachary & Emmanuel Raviart
|
|
22
|
+
- © 2022 Emmanuel Raviart
|
|
23
|
+
- © 2023, 2024, 2025, 2026 Logora & Emmanuel Raviart
|
|
14
24
|
|
|
15
25
|
https://git.tricoteuses.fr/logiciels/tricoteuses-assemblee
|
|
16
26
|
|
package/README.md
CHANGED
|
@@ -10,22 +10,7 @@ _Tricoteuses Légifrance_ is free and open source software.
|
|
|
10
10
|
## documentation
|
|
11
11
|
|
|
12
12
|
- [Architecture](doc/architecture.md)
|
|
13
|
-
- [
|
|
14
|
-
- Main interfaces:
|
|
15
|
-
- [Acteur : personne physique élue ou nommée dans des organes](doc/api/README/interfaces/Acteur.md)
|
|
16
|
-
- [Amendement](doc/api/README/interfaces/Amendement.md)
|
|
17
|
-
- [CompteRendu : compte-rendu d'un débat parlementaire](doc/api/README/interfaces/CompteRendu.md)
|
|
18
|
-
- [Document : texte d'un projet de loi, d'une proposition de loi, d'un rapport, etc](doc/api/README/interfaces/Document.md)
|
|
19
|
-
- [DossierParlementaire : Dossier de suivi d'un projet ou d'une proposition de loi, d'une résolution, etc](doc/api/README/interfaces/DossierParlementaire.md)
|
|
20
|
-
- [Organe : commission, groupe politique, groupe d'étude, groupe d'amitié, etc](doc/api/README/interfaces/Organe.md)
|
|
21
|
-
- [Question : question au Gouvernement](doc/api/README/interfaces/Question.md)
|
|
22
|
-
- [Reunion : séance publique, réunion de commission, de groupe d'étude, etc](doc/api/README/interfaces/Reunion.md)
|
|
23
|
-
- [Scrutin : vote de chaque député lors d'un scrutin public](doc/api/README/interfaces/Scrutin.md)
|
|
24
|
-
- [JSON Schemas](src/schemas)
|
|
25
|
-
|
|
26
|
-
## Requirements
|
|
27
|
-
|
|
28
|
-
- Node >= 18
|
|
13
|
+
- [Browser Usage](doc/BROWSER_USAGE.md) - Using this package in browser/Vite projects
|
|
29
14
|
|
|
30
15
|
## Installation
|
|
31
16
|
|
|
@@ -93,6 +78,7 @@ npm run data:download ../assemblee-data -- -l 16 -l 17
|
|
|
93
78
|
- `--clone` or `-C <url>`: Clone Git repositories from a remote group or organization
|
|
94
79
|
- `--remote` or `-r <name>`: Push commits to specified Git remote(s)
|
|
95
80
|
- `--keepDir`: Keep Dir (Implement before cleaning data)
|
|
81
|
+
- `--only-recent` (number): If files are already present, skip files that are above the specified number of days and skip old legislatures (e.g. `-only-recent 30`)
|
|
96
82
|
|
|
97
83
|
If you use such options, use them in all subsequent commands too (_data:regorganize_data_ and _data:clean_data_).
|
|
98
84
|
|
|
@@ -147,6 +133,3 @@ for (const { acteur } of iterLoadAssembleeActeurs("../assemblee-data", 17)) {
|
|
|
147
133
|
}
|
|
148
134
|
```
|
|
149
135
|
|
|
150
|
-
## Generating schemas and documentation (for contributors only)
|
|
151
|
-
|
|
152
|
-
View instructions [here](https://git.tricoteuses.fr/logiciels/tricoteuses-assemblee/-/blob/master/src/types)
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import f from "node:assert";
|
|
2
|
+
import { u as m } from "./amendements-CZHXlq07.js";
|
|
3
|
+
const b = {
|
|
4
|
+
false: !1,
|
|
5
|
+
true: !0
|
|
6
|
+
}, y = "http://schemas.assemblee-nationale.fr/referentiel", x = "http://www.w3.org/2001/XMLSchema-instance";
|
|
7
|
+
function v(e, i) {
|
|
8
|
+
const t = e[i];
|
|
9
|
+
if (t == null) {
|
|
10
|
+
delete e[i];
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const r = b[t];
|
|
14
|
+
return f.notStrictEqual(
|
|
15
|
+
r,
|
|
16
|
+
void 0,
|
|
17
|
+
`Invalid boolean value: ${i} = ${t}`
|
|
18
|
+
), e[i] = r, r;
|
|
19
|
+
}
|
|
20
|
+
function O(e, i) {
|
|
21
|
+
const t = e[i];
|
|
22
|
+
if (t == null) {
|
|
23
|
+
delete e[i];
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const r = Number.parseInt(t);
|
|
27
|
+
return f(
|
|
28
|
+
!Number.isNaN(r),
|
|
29
|
+
`Invalid number value: ${i} = ${t}`
|
|
30
|
+
), e[i] = r, r;
|
|
31
|
+
}
|
|
32
|
+
function o(e, { recursive: i } = {}) {
|
|
33
|
+
if (e != null) {
|
|
34
|
+
if (Array.isArray(e)) {
|
|
35
|
+
if (e.length === 0)
|
|
36
|
+
return;
|
|
37
|
+
if (i)
|
|
38
|
+
for (const [t, r] of e.entries()) {
|
|
39
|
+
const a = o(r, { recursive: i });
|
|
40
|
+
a !== r && (e[t] = a ?? null);
|
|
41
|
+
}
|
|
42
|
+
return e;
|
|
43
|
+
}
|
|
44
|
+
if (typeof e == "object" && e.constructor === Object) {
|
|
45
|
+
const t = e;
|
|
46
|
+
if (Object.keys(t).length === 0 || t["@xsi:nil"] === "true")
|
|
47
|
+
return;
|
|
48
|
+
const r = t["@xmlns"] ?? t.xmlns;
|
|
49
|
+
if (r !== void 0 && (f.strictEqual(r, y), delete t["@xmlns"], delete t.xmlns), t["@xmlns:xsi"] === x && delete t["@xmlns:xsi"], i)
|
|
50
|
+
for (const [a, c] of Object.entries(t)) {
|
|
51
|
+
const d = o(c, { recursive: i });
|
|
52
|
+
d === void 0 ? delete t[a] : d !== c && (t[a] = d);
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
for (const [a, c] of Object.entries(t))
|
|
56
|
+
(c == null || c["@xsi:nil"] === "true" || Array.isArray(c) && c.length === 0 || !Array.isArray(c) && c.constructor === Object && Object.keys(c).length === 0) && delete t[a];
|
|
57
|
+
return Object.keys(t).length === 0 ? void 0 : t;
|
|
58
|
+
}
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function _(e) {
|
|
63
|
+
o(e);
|
|
64
|
+
const i = e.signataires;
|
|
65
|
+
{
|
|
66
|
+
o(i);
|
|
67
|
+
const s = i.auteur;
|
|
68
|
+
if (o(s), i.cosignataires !== void 0) {
|
|
69
|
+
const l = i.cosignataires.acteurRef;
|
|
70
|
+
Array.isArray(l) ? i.cosignatairesRefs = l : (f(l), i.cosignatairesRefs = [l]), delete i.cosignataires;
|
|
71
|
+
}
|
|
72
|
+
let n = i.libelle;
|
|
73
|
+
n !== void 0 && (n = n.replace(/ |\u00A0/g, " ").split(" ").filter(Boolean).join(" "), n ? i.libelle = n : delete i.libelle);
|
|
74
|
+
}
|
|
75
|
+
const t = e.pointeurFragmentTexte;
|
|
76
|
+
{
|
|
77
|
+
o(t);
|
|
78
|
+
const s = t.division;
|
|
79
|
+
if (s !== void 0) {
|
|
80
|
+
o(s);
|
|
81
|
+
let l = s.avant_A_Apres;
|
|
82
|
+
l !== void 0 && (delete s.avant_A_Apres, l === "Après" && (l = "Apres"), s.avantAApres = l);
|
|
83
|
+
}
|
|
84
|
+
const n = t.amendementStandard;
|
|
85
|
+
if (n !== void 0) {
|
|
86
|
+
o(n);
|
|
87
|
+
const l = n.alinea;
|
|
88
|
+
if (l !== void 0) {
|
|
89
|
+
o(l);
|
|
90
|
+
let u = l.avant_A_Apres;
|
|
91
|
+
u !== void 0 && (delete l.avant_A_Apres, u === "Après" ? u = "Apres" : m.includes(u) || (u = "A"), l.avantAApres = u), t.alinea = l;
|
|
92
|
+
}
|
|
93
|
+
delete t.amendementStandard;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const r = e.corps;
|
|
97
|
+
if (r !== void 0) {
|
|
98
|
+
o(r);
|
|
99
|
+
const s = r.contenuAuteur;
|
|
100
|
+
if (s !== void 0) {
|
|
101
|
+
o(s);
|
|
102
|
+
const n = s.avantAppel;
|
|
103
|
+
n !== void 0 && (o(n), A(n.dispositifAmdtCreditPLF, {
|
|
104
|
+
rectificatif: !1
|
|
105
|
+
}), A(n.dispositifAmdtCreditPLFR, {
|
|
106
|
+
rectificatif: !0
|
|
107
|
+
}), Object.keys(n).length === 0 && delete s.avantAppel), f.strictEqual(s.annexeExposeSommaire, void 0), A(s.dispositifAmdtCreditPLF, {
|
|
108
|
+
rectificatif: !1
|
|
109
|
+
}), A(s.dispositifAmdtCreditPLFR, {
|
|
110
|
+
rectificatif: !0
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const a = e.cycleDeVie;
|
|
115
|
+
if (a !== void 0) {
|
|
116
|
+
o(a);
|
|
117
|
+
const s = a.etatDesTraitements;
|
|
118
|
+
{
|
|
119
|
+
o(s);
|
|
120
|
+
const n = s.etat;
|
|
121
|
+
o(n);
|
|
122
|
+
const l = s.sousEtat;
|
|
123
|
+
l !== void 0 && o(l);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (e.representations !== void 0) {
|
|
127
|
+
const s = e.representations.representation;
|
|
128
|
+
f(!Array.isArray(s)), e.representation = s, delete e.representations;
|
|
129
|
+
{
|
|
130
|
+
o(s), f.strictEqual(s.repSource, void 0), f.strictEqual(s.offset, void 0), f.strictEqual(s.dateDispoRepresentation, void 0);
|
|
131
|
+
const n = s.statutRepresentation;
|
|
132
|
+
v(n, "canonique"), v(n, "enregistrement"), v(n, "officielle"), v(n, "transcription"), v(n, "verbatim");
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const c = e.loiReference;
|
|
136
|
+
c !== void 0 && o(c);
|
|
137
|
+
const d = e.discussionCommune;
|
|
138
|
+
d !== void 0 && o(d);
|
|
139
|
+
const p = e.discussionIdentique;
|
|
140
|
+
return p !== void 0 && o(p), e;
|
|
141
|
+
}
|
|
142
|
+
function A(e, { rectificatif: i }) {
|
|
143
|
+
if (e !== void 0) {
|
|
144
|
+
const t = e.listeProgrammes?.programme;
|
|
145
|
+
if (t !== void 0) {
|
|
146
|
+
Array.isArray(t) ? e.listeProgrammes = t : (f(t), e.listeProgrammes = [t]);
|
|
147
|
+
for (const r of e.listeProgrammes)
|
|
148
|
+
if (o(r), r.lignesCredits !== void 0) {
|
|
149
|
+
let a = r.lignesCredits.ligneCredit;
|
|
150
|
+
if (a === void 0 ? delete r.lignesCredits : (Array.isArray(a) || (f(a), a = [a]), r.lignesCredits = a), a !== void 0)
|
|
151
|
+
for (const c of a)
|
|
152
|
+
i ? g(c) : o(c);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function g(e) {
|
|
158
|
+
if (o(e), e.lignesCredits !== void 0) {
|
|
159
|
+
let i = e.lignesCredits.ligneCredit;
|
|
160
|
+
if (i === void 0 ? delete e.lignesCredits : (Array.isArray(i) || (f(i), i = [i]), e.lignesCredits = i), i !== void 0)
|
|
161
|
+
for (const t of i)
|
|
162
|
+
g(t);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
export {
|
|
166
|
+
v as a,
|
|
167
|
+
O as b,
|
|
168
|
+
o as c,
|
|
169
|
+
_ as d
|
|
170
|
+
};
|