From 3916915e222e458a0f9e72956c07f7821fd3f950 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sat, 2 Mar 2024 09:45:38 +0100 Subject: [PATCH] Feat: add import from Nextcloud --- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Makefile b/Makefile index e20935b..9e86597 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,40 @@ +DATA_BASE=./datas + +PDF_BASE=$(DATA_BASE)/pdfs +PDF_YEARS=$(wildcard $(PDF_BASE)/*) + +RAW_BASE=$(DATA_BASE)/raw +RAW_CRG=$(RAW_BASE)/CRG +RAW_CRG_YEARS=$(subst $(PDF_BASE), $(RAW_CRG), $(PDF_YEARS)) + + +$(RAW_CRG)/%/: $(wildcard $(PDF_BASE)/%/*) + echo $(wildcard $(PDF_BASE)/$*/*) + @echo ---- + ls $(PDF_BASE)/$*/ + @echo ---- + echo $* + @echo ---- + echo $^ + @echo ---- + echo $? + +#./datas/raw/CRG/%: +#pdf-oralia extract all --src $$year --dest $$(subst $$PDF_BASE, $$RAW_CRG, $$year) +# $(RAW_CRG_YEARS): $(PDF_PATHS) +# for year in $(PDF_PATHS); do \ +# echo $$year; \ +# echo $$(subst $$PDF_BASE, $$RAW_CRG, $$year); \ +# echo "----"; \ +# done; + +extract_pdfs: + for year in 2021 2022 2023 2024; do \ + mkdir -p $(RAW_CRG)/$$year/extracted;\ + pdf-oralia extract all --src $(PDF_BASE)/$$year/ --dest $(RAW_CRG)/$$year/extracted; \ + pdf-oralia join --src $(RAW_CRG)/$$year/extracted/ --dest $(RAW_CRG)/$$year/; \ + done + clean_raw: rm -rf ./PLESNA Compta SYSTEM/raw/**/*.csv @@ -8,3 +45,5 @@ clean_built: clean_all: clean_built clean_raw +import_nextcloud: + rsync -a ~/Nextcloud/PLESNA\ Compta\ SYSTEM/Histoire/ ./datas/Histoire