Tricoteuses Légifrance is free and open source software.
- Architecture
-
TypeScript API
- Main interfaces:
- Acteur : personne physique élue ou nommée dans des organes
- Amendement
- CompteRendu : compte-rendu d'un débat parlementaire
- Document : texte d'un projet de loi, d'une proposition de loi, d'un rapport, etc
- DossierParlementaire : Dossier de suivi d'un projet ou d'une proposition de loi, d'une résolution, etc
- Organe : commission, groupe politique, groupe d'étude, groupe d'amitié, etc
- Question : question au Gouvernement
- Reunion : séance publique, réunion de commission, de groupe d'étude, etc
- Scrutin : vote de chaque député lors d'un scrutin public
- Main interfaces:
- JSON Schemas
- Node >= 18
git clone https://git.tricoteuses.fr/logiciels/tricoteuses-assemblee
cd tricoteuses-assemblee/
npm install
Create a folder where the data will be downloaded and run the following command to download, reorganize and clean the data.
mkdir ../assemblee-data/
# Download and clean open data
npm run data:download ../assemblee-data
Data from other sources is also available :
# Retrieval of députés' pictures from Assemblée nationale's website
npm run data:retrieve_deputes_photos ../assemblee-data
# Retrieval of sénateurs' pictures from Assemblée nationale's website
npm run data:retrieve_senateurs_photos ../assemblee-data
# Retrieval of pending amendments from Assemblée nationale's website (waiting to be processed by Assemblée services)
npm run data:retrieve_pending_amendements ../assemblee-data
Notes:
- Reorganized files (generated by the data:reorganize_data command) are also available in Tricoteuses / Data / Données brutes de l'Assemblée. They are updated on a regular basis.
- Split & cleaned files (generated by the data:clean_data command) are also available in Tricoteuses / Data / Données nettoyées de l'Assemblée with the
_nettoye
suffix. They are updated on a regular basis.
Downloading and cleaning all the data is long and takes up a lot of disk space. It is possible to choose the type of data that you want to retrieve to reduce the load.
To download only a type of dataset, use the --categories option (shortcut -k) :
# Available options : ActeursEtOrganes, Agendas, Amendements, DossiersLegislatifs, Photos, Scrutins, Questions, ComptesRendusSeances
npm run data:download ../assemblee-data -- --categories Amendements
To download a specific or multiple legislatures, use the --legislature option (shortcut -l):
# Available options : 14, 15, 16, 17
npm run data:download ../assemblee-data -- -l 16 -l 17
If you use such options, use them in all subsequent commands too (data:regorganize_data and data:clean_data).
A Docker image that downloads and cleans the data all at once is available. Build it locally or run it from the container registry.
Use the environment variables LEGISLATURE
and CATEGORIES
if needed.
docker run --pull always --name tricoteuses-assemblee -v ../assemblee-data:/app/assemblee-data -e LEGISLATURE=17 -d git.tricoteuses.fr/logiciels/tricoteuses-assemblee:latest
Once the data is downloaded and cleaned, you can use loaders to retrieve it. To use loaders in your project, you can install the @tricoteuses/assemblee package, and import the iterator functions that you need.
npm install @tricoteuses/assemblee
import {
iterLoadAssembleeActeurs,
iterLoadAssembleeOrganes,
iterLoadAssembleeReunions,
iterLoadAssembleeScrutins,
iterLoadAssembleeDocuments,
iterLoadAssembleeDossiersParlementaires,
iterLoadAssembleeAmendements,
iterLoadAssembleeQuestions,
iterLoadAssembleeComptesRendus,
} from "@tricoteuses/assemblee/loaders";
// Pass data directory and legislature as arguments
for (const { acteur } of iterLoadAssembleeActeurs("../assemblee-data", 17)) {
console.log(acteur.uid)
}
View instructions here