@tricoteuses/senat 1.0.1 → 1.1.2
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 +4 -1
- package/lib/aggregates.d.ts +54 -0
- package/lib/aggregates.js +1122 -0
- package/lib/aggregates.mjs +802 -0
- package/lib/aggregates.ts +947 -0
- package/lib/datasets.d.ts +1 -0
- package/lib/datasets.js +9 -1
- package/lib/datasets.mjs +10 -0
- package/lib/datasets.ts +11 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +14 -1
- package/lib/index.mjs +1 -0
- package/lib/index.ts +4 -0
- package/lib/inserters.d.ts +5 -1
- package/lib/inserters.js +22 -3
- package/lib/inserters.mjs +19 -3
- package/lib/inserters.ts +27 -2
- package/lib/model/ameli.d.ts +4 -0
- package/lib/model/ameli.js +167 -0
- package/lib/model/ameli.mjs +57 -0
- package/lib/model/ameli.ts +86 -0
- package/lib/model/debats.d.ts +4 -0
- package/lib/model/debats.js +123 -0
- package/lib/model/debats.mjs +43 -0
- package/lib/model/debats.ts +68 -0
- package/lib/model/dosleg.d.ts +29 -0
- package/lib/model/dosleg.js +840 -0
- package/lib/model/dosleg.mjs +337 -0
- package/lib/model/dosleg.ts +558 -0
- package/lib/model/index.d.ts +5 -0
- package/lib/model/index.js +48 -0
- package/lib/model/index.mjs +5 -0
- package/lib/model/index.ts +11 -0
- package/lib/model/questions.d.ts +2 -0
- package/lib/model/questions.js +52 -0
- package/lib/model/questions.mjs +8 -0
- package/lib/model/questions.ts +14 -0
- package/lib/model/sens.d.ts +2 -0
- package/lib/model/sens.js +57 -0
- package/lib/model/sens.mjs +9 -0
- package/lib/model/sens.ts +18 -0
- package/lib/model/util.d.ts +1 -0
- package/lib/model/util.js +60 -0
- package/lib/model/util.mjs +10 -0
- package/lib/model/util.ts +16 -0
- package/lib/raw_types/questions.d.ts +226 -2
- package/lib/raw_types/questions.js +18 -5
- package/lib/raw_types/questions.mjs +1 -8
- package/lib/raw_types/questions.ts +242 -2
- package/lib/scripts/convert_data.d.ts +1 -0
- package/lib/scripts/convert_data.js +284 -0
- package/lib/scripts/convert_data.mjs +146 -0
- package/lib/scripts/convert_data.ts +182 -0
- package/lib/scripts/fix_db.d.ts +1 -0
- package/lib/scripts/fix_db.js +144 -0
- package/lib/scripts/fix_db.mjs +64 -0
- package/lib/scripts/fix_db.ts +75 -0
- package/lib/scripts/retrieve_open_data.js +20 -15
- package/lib/scripts/retrieve_open_data.mjs +20 -17
- package/lib/scripts/retrieve_open_data.ts +26 -22
- package/lib/scripts/retrieve_textes.js +4 -2
- package/lib/scripts/retrieve_textes.mjs +3 -1
- package/lib/scripts/retrieve_textes.ts +6 -4
- package/lib/types/questions.d.ts +2 -0
- package/lib/types/questions.js +13 -1
- package/lib/types/questions.mjs +1 -1
- package/lib/types/questions.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
git clone https://git.en-root.org/tricoteuses/tricoteuses-senat
|
|
9
|
-
cd tricoteuses-
|
|
9
|
+
cd tricoteuses-senat/
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Create a `.env` file to set PostgreSQL database informations and other configuration variables (you can use `example.env` as a template). Then
|
|
@@ -34,6 +34,8 @@ docker exec -it local-postgres psql -U postgres -c "CREATE ROLE opendata;"
|
|
|
34
34
|
mkdir ../senat-data/
|
|
35
35
|
npx babel-node --extensions ".ts" --max-old-space-size=4096 -- src/scripts/retrieve_open_data.ts --fetch --unzip --repair-encoding ../senat-data/
|
|
36
36
|
npx babel-node --extensions ".ts" -- src/scripts/retrieve_open_data.ts --import ../senat-data/
|
|
37
|
+
npx babel-node --extensions ".ts" -- src/scripts/fix_db.ts --updateSchema
|
|
38
|
+
npx babel-node --extensions ".ts" -- src/scripts/convert_data.ts ../senat-data/ [--categories DosLeg]
|
|
37
39
|
```
|
|
38
40
|
|
|
39
41
|
## Retrieval of sénateurs' pictures from Sénat's website
|
|
@@ -50,6 +52,7 @@ npx babel-node --extensions ".ts" -- src/scripts/retrieve_textes.ts ../senat-dat
|
|
|
50
52
|
|
|
51
53
|
### Generation of raw types from SQL schema.
|
|
52
54
|
|
|
55
|
+
To be run after database has been fixed (`src/scripts/fix_db.ts --updateSchema`).
|
|
53
56
|
```bash
|
|
54
57
|
npx babel-node --extensions ".ts" -- src/scripts/retrieve_open_data.ts --schema ../senat-data/
|
|
55
58
|
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Ses, Sub, TxtAmeli } from './types/ameli';
|
|
2
|
+
import { Debat } from './types/debats';
|
|
3
|
+
import { Ass, Aud, Auteur, DateSeance, DecCoc, DenRap, DocAtt, Ecr, EtaLoi, LecAss, LecAssRap, Lecture, Loi, Org, OriTxt, Qua, Rap, Scr, Texte, TypAtt, TypLec, TypLoi, TypTxt, TypUrl } from './types/dosleg';
|
|
4
|
+
import { Question } from './types/questions';
|
|
5
|
+
import { Sen } from './types/sens';
|
|
6
|
+
export declare const allFollows: string[];
|
|
7
|
+
export declare class Aggregator {
|
|
8
|
+
follow: Set<string>;
|
|
9
|
+
objectByIdByTableName: {
|
|
10
|
+
[name: string]: {
|
|
11
|
+
[id: string]: object;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
requestedIdsByTableName: {
|
|
15
|
+
[name: string]: Set<string>;
|
|
16
|
+
};
|
|
17
|
+
visitedIdsByTableName: {
|
|
18
|
+
[name: string]: Set<string>;
|
|
19
|
+
};
|
|
20
|
+
constructor(follow: Set<string>);
|
|
21
|
+
addAss(ass: Ass): void;
|
|
22
|
+
addAud(aud: Aud): void;
|
|
23
|
+
addAuteur(auteur: Auteur): void;
|
|
24
|
+
addDateSeance(dateSeance: DateSeance): void;
|
|
25
|
+
addDebat(debat: Debat): void;
|
|
26
|
+
addDeccoc(deccoc: DecCoc): void;
|
|
27
|
+
addDenrap(denrap: DenRap): void;
|
|
28
|
+
addDocatt(docatt: DocAtt): void;
|
|
29
|
+
addEcr(ecr: Ecr): void;
|
|
30
|
+
addEtaloi(etaloi: EtaLoi): void;
|
|
31
|
+
addLecass(lecass: LecAss): void;
|
|
32
|
+
addLecassrap(lecassrap: LecAssRap): void;
|
|
33
|
+
addLecture(lecture: Lecture): void;
|
|
34
|
+
addLoi(loi: Loi): void;
|
|
35
|
+
addOrg(org: Org): void;
|
|
36
|
+
addOritxt(oritxt: OriTxt): void;
|
|
37
|
+
addQua(qua: Qua): void;
|
|
38
|
+
addQuestion(question: Question): void;
|
|
39
|
+
addRap(rap: Rap): void;
|
|
40
|
+
addScr(scr: Scr): void;
|
|
41
|
+
addSen(sen: Sen): void;
|
|
42
|
+
addSes(ses: Ses): void;
|
|
43
|
+
addSub(sub: Sub): void;
|
|
44
|
+
addTexte(texte: Texte): void;
|
|
45
|
+
addTxtAmeli(txtAmeli: TxtAmeli): void;
|
|
46
|
+
addTypatt(typatt: TypAtt): void;
|
|
47
|
+
addTyplec(typlec: TypLec): void;
|
|
48
|
+
addTyploi(typloi: TypLoi): void;
|
|
49
|
+
addTyptxt(typtxt: TypTxt): void;
|
|
50
|
+
addTypurl(typurl: TypUrl): void;
|
|
51
|
+
getAll(): Promise<void>;
|
|
52
|
+
request(tableName: string, id: string): void;
|
|
53
|
+
toJson(): any;
|
|
54
|
+
}
|