-
Notifications
You must be signed in to change notification settings - Fork 9
/
update_dossiers.sh
executable file
·44 lines (34 loc) · 1.35 KB
/
update_dossiers.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
trap ctrl_c INT
function ctrl_c() {
exit 1;
}
cd $(dirname $0)
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH" # if `pyenv` is not already on PATH
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
pyenv activate lafabrique
DATADIR=data
echo "Parsing new promulgated texts..."
senapy-cli doslegs_urls --min-year=$((`date +%Y`)) | tlfp-parse-many $DATADIR --only-promulgated --quiet
echo
echo "Parsing texts in discussion..."
TMPDIR=$(mktemp -d)
anpy-cli doslegs_urls --in-discussion --senate-urls > $TMPDIR/urls_AN
senapy-cli doslegs_urls --in-discussion > $TMPDIR/urls_SENATE
head -n 2 data/logs-encours/* | grep '^http' > $TMPDIR/urls_ERRORS
sort -u $TMPDIR/* | tlfp-parse-many $DATADIR --quiet
rm -rf $TMPDIR
echo
python tlfp/generate_dossiers_csv.py $DATADIR
python tlfp/tools/assemble_procedures.py $DATADIR > /dev/null
echo
echo "Make metrics.csv..."
python tlfp/tools/make_metrics_csv.py $DATADIR --quiet
python tlfp/tools/steps_as_dot.py $DATADIR | dot -Tsvg > $DATADIR/stats/steps.svg
python tlfp/tools/steps_as_dot.py $DATADIR | dot -Tpng > $DATADIR/stats/steps.png
python tlfp/tools/steps_as_dot.py $DATADIR 1 | dot -Tsvg > $DATADIR/stats/steps-detailed.svg
python tlfp/tools/steps_as_dot.py $DATADIR 1 | dot -Tpng > $DATADIR/stats/steps-detailed.png