npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tricoteuses/assemblee

v2.5.16

Published

Retrieve, clean up & handle French Assemblée nationale's open data

Downloads

4,208

Readme

Tricoteuses-Assemblee

Retrieve, clean up & handle French Assemblée nationale's open data

Tricoteuses Légifrance is free and open source software.

documentation

Requirements

  • Node >= 18

Installation

git clone https://git.tricoteuses.fr/logiciels/tricoteuses-assemblee
cd tricoteuses-assemblee/
npm install

Download and clean data

Basic usage

Create a directory to store the data, then run the following command to download, reorganize and clean the data.

mkdir ../assemblee-data/
npm run data:download ../assemblee-data

Available Commands

  • npm run data:download <dir>: Download, reorganize, and clean data
  • npm run data:retrieve_open_data <dir>: Download raw data files.
  • npm run data:reorganize_data <dir>: Reorganize raw files by entity.
  • npm run data:clean_data <dir>: Clean and validate reorganized files.
  • npm run data:retrieve_deputes_photos <dir>: Retrieval of députés' pictures from Assemblée nationale's website
  • npm run data:retrieve_senateurs_photos <dir>: Retrieval of sénateurs' pictures from Assemblée nationale's website
  • npm run data:retrieve_documents <dir>: Retrieval of legislative documents from Assemblée nationale's website
  • npm run data:retrieve_pending_amendements <dir>: Retrieval of pending amendments from Assemblée nationale's website (waiting to be processed by Assemblée services)

Notes:

Filtering Options

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.

Examples:

# Only download amendments
npm run data:download ../assemblee-data -- -k Amendements

# Only process 16th and 17th legislatures
npm run data:download ../assemblee-data -- -l 16 -l 17

Common Options

  • --categories or -k <name>: Filter by dataset categories (Available options : ActeursEtOrganes, Agendas, Amendements, DossiersLegislatifs, Photos, Scrutins, Questions, ComptesRendusSeances)

  • --legislature or -l <number>: Specify one or more legislatures to process (e.g., -l 15 -l 16)

  • --dataDir <path> (Mandatory): Path to the working directory where all data is stored (required)

  • --silent or -s: Disable logging

  • --verbose or -v: Enable verbose logging

  • --fetch or -f: Force re-download of data even if already present

  • --commit or -c: Automatically commit cleaned data

  • --pull or -p: Pull repositories before starting

  • --clone or -C <url>: Clone Git repositories from a remote group or organization

  • --remote or -r <name>: Push commits to specified Git remote(s)

  • --keepDir: Keep Dir (Implement before cleaning data)

If you use such options, use them in all subsequent commands too (data:regorganize_data and data:clean_data).

Options for Cleaning Data

  • --dataset or -d <name>: Clean a specific dataset only
  • --no-reset-after-commit: Skip Git reset after committing (useful to preserve local changes)
  • --no-validate or -V: Skip schema validation during cleaning
  • --fetchDocuments : Specify to retrieve documents
  • --parseDocuments: Specify to parse documents into cleaned json
  • --fetchVideos: Retrieve videos

Options for Retrieving Documents

  • --full or -f: Retrieve all documents, even those already downloaded
  • --document-type or -T <type>: Restrict to specific document types (e.g., PION)

Download using Docker

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

Using the data

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)
}

Generating schemas and documentation (for contributors only)

View instructions here