@tricoteuses/annuaire
v0.0.5
Published
Library, web API & site to browse "Service-public.fr - Annuaire de l'administration" open data from French Direction de l'information légale et administrative (Dila)
Downloads
13
Readme
Tricoteuses Annuaire
Library, web API & site to browse "Service-public.fr - Annuaire de l'administration" open data from French Direction de l'information légale et administrative (Dila)
Tricoteuses Annuaire is free and open source software.
"Service-public.fr - Référentiel de l'organisation administrative de l'État" data sources:
- https://www.dila.premier-ministre.gouv.fr/repertoire-des-informations-publiques/les-donnees-administratives
- https://www.data.gouv.fr/fr/datasets/referentiel-de-lorganisation-administrative-de-letat/
- https://echanges.dila.gouv.fr/OPENDATA/RefOrgaAdminEtat/
"Service-public.fr - Annuaire de l'administration - Base de données locales" data sources:
- https://www.dila.premier-ministre.gouv.fr/repertoire-des-informations-publiques/les-donnees-administratives
- https://www.data.gouv.fr/fr/datasets/service-public-fr-annuaire-de-l-administration-base-de-donnees-locales/
- https://lecomarquage.service-public.fr/donnees_locales_v4/
Installation
Create database
Using Debian GNU/Linux, install PostgreSQL, then:
sudo su - postgres
createuser annuaire -P # and enter the password
createdb -O annuaire annuaire
psql annuaire
CREATE EXTENSION IF NOT EXISTS pg_trgm;
\q
exit
Install dependencies
npm install
Server Configuration
Create a .env
file to set configuration variables (you can use example.env
as a template). Then:
npm run configure
Datasets Initialization
mkdir -p ../dila-data/annuaire/organisation_administrative_etat
cd ../dila-data/annuaire/organisation_administrative_etat
git init
git branch -m main
cd -
mkdir -p ../dila-data/annuaire/donnees_locales
cd ../dila-data/annuaire/donnees_locales
git init
git branch -m main
cd -
Datasets Update
# Download annuaire & clean it up.
npx tsx src/scripts/download_organisation_administrative_etat.ts --push
npx tsx src/scripts/clean_organisation_administrative_etat_json.ts --push
npx tsx src/scripts/download_donnees_locales.ts --push
npx tsx src/scripts/clean_donnees_locales_json.ts --push
Database Update
npx tsx src/scripts/import_annuaire.ts
Server Launch
In development mode:
npm run dev
In production mode:
npm run build
npm run preview
Development
JSON Schemas Generation
npx tsx src/scripts/generate_annuaire_json_schemas.ts
# Prettify generated JSON file.
npm run format