@tricoteuses/tisseuse
v0.13.3
Published
Find links in/to French legislative documents
Readme
Tricoteuses Tisseuse
Find links in/to French legislative documents
Tricoteuses Tisseuse is free and open source software.
Tricoteuses Tisseuse started from a full rewrite of Metslesliens by Seb35, published under the "DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE" (WTFPL) version 2.
Installation
Create database
Using Debian GNU/Linux, install PostgreSQL, then:
sudo su - postgres
createuser tisseuse -P # and enter the password
createdb -O tisseuse tisseuse
psql tisseuse
CREATE EXTENSION IF NOT EXISTS pg_trgm;
\q
exitInstall dependencies
npm installServer Configuration
Create a .env file to set configuration variables (you can use example.env as a template). Then:
npm run configureLegal reference resolver
Tisseuse resolves legal references through a LegiResolver. The default
resolver is canutes, which uses the configured Canutes database and a generated
text_titles_infos.json file.
There are two supported resolver paths for tests and scripts:
f_legi: uses the flat f_legi database and does not need a generatedtext_titles_infos.jsonfile.canutes: uses the Canutes database and requires generatingsrc/lib/text_parsers/text_titles_infos.jsonbefore running tests that parse or resolve French text titles.
Use f_legi explicitly when you want to run against the flat f_legi database:
TISSEUSE_LEGI_RESOLVER=f_legi npm test
npx tsx src/scripts/parse_assemblee_bill_raw.ts bill.html.raw --resolver f_legiFor the default Canutes resolver, generate the text title index first, then run the tests:
npx tsx src/scripts/extract_texts_titles_infos.ts
npm testThis creates src/lib/text_parsers/text_titles_infos.json. It is generated from
the Canutes database, is listed in .gitignore, and must never be committed.
If you need to keep the generated file outside the working tree, pass it through
TISSEUSE_TEXT_TITLES_INFOS_PATH or script options instead:
TISSEUSE_TEXT_TITLES_INFOS_PATH=/path/to/text_titles_infos.json npm test
npx tsx src/scripts/parse_akoma_ntoso_bill_raw.ts bill.akn.xml.raw --text-titles-infos /path/to/text_titles_infos.jsonIf no path is supplied, the Canutes resolver first tries
src/lib/text_parsers/text_titles_infos.json from the current working tree, then
the same generated file in the local tisseuse package source tree. That file is
generated data and is not loaded through Vitest global setup; tests that need it
preload it explicitly through the selected resolver.
