Export and Import
This commit is contained in:
+15
-19
@@ -1,7 +1,7 @@
|
|||||||
#+title: Script
|
#+title: Script
|
||||||
#+author: Sébastien Miquel
|
#+author: Sébastien Miquel
|
||||||
#+date: 14-03-2026
|
#+date: 14-03-2026
|
||||||
# Time-stamp: <08-08-26 16:44>
|
# Time-stamp: <20-08-26 09:59>
|
||||||
#+OPTIONS:
|
#+OPTIONS:
|
||||||
|
|
||||||
* Méta
|
* Méta
|
||||||
@@ -155,7 +155,7 @@ Mettre les copies scannées au format pdf dans =Interro=.
|
|||||||
|
|
||||||
** Labelisation et regroupement
|
** Labelisation et regroupement
|
||||||
|
|
||||||
Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
Optional : Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
||||||
|
|
||||||
1. =python gemini_for_labels.py Interro=, avec éventuellement =--overwrite=
|
1. =python gemini_for_labels.py Interro=, avec éventuellement =--overwrite=
|
||||||
|
|
||||||
@@ -179,8 +179,7 @@ Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
|||||||
En cas de soucis, (par exemple les pages ne sont pas dans le bon ordre)
|
En cas de soucis, (par exemple les pages ne sont pas dans le bon ordre)
|
||||||
- Réordonner les pages du fichier pdf
|
- Réordonner les pages du fichier pdf
|
||||||
- Rerun =python cutleft.py Interro/Copie{id}=
|
- Rerun =python cutleft.py Interro/Copie{id}=
|
||||||
- Rerun =python gemini_dir_batching.py Interro/Copie{id}=
|
- Rerun =python gemini_for_labels.py Interro/Copie{id}=
|
||||||
?? À vérifier, pas sûr que ça marche.
|
|
||||||
3. =python splitting_int.py Interro=
|
3. =python splitting_int.py Interro=
|
||||||
|
|
||||||
Découpe les copies suivant les exercices
|
Découpe les copies suivant les exercices
|
||||||
@@ -192,7 +191,7 @@ Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
|||||||
|
|
||||||
** Correction et annotation
|
** Correction et annotation
|
||||||
|
|
||||||
Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
Optional : Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
||||||
|
|
||||||
1. Il faut créer des persp, pour indication de comment corriger, et
|
1. Il faut créer des persp, pour indication de comment corriger, et
|
||||||
relancer =enonce_info.py=
|
relancer =enonce_info.py=
|
||||||
@@ -222,7 +221,7 @@ Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
|||||||
- Essaye de corriger des erreurs d'encodage/d'accents dans
|
- Essaye de corriger des erreurs d'encodage/d'accents dans
|
||||||
=correction.json=.
|
=correction.json=.
|
||||||
- aussi échappe les `_` en dehors du mode math, pour LaTeX.
|
- aussi échappe les `_` en dehors du mode math, pour LaTeX.
|
||||||
4. Résolution manuel de conflits
|
4. Résolution manuel de conflits, s'il y en a.
|
||||||
|
|
||||||
Edit `manual_resolutions.txt`. Use :
|
Edit `manual_resolutions.txt`. Use :
|
||||||
+ `->` or `x>` : Here set a pipe `|` before or after the new_label name
|
+ `->` or `x>` : Here set a pipe `|` before or after the new_label name
|
||||||
@@ -242,7 +241,7 @@ Set proxy with ~export HTTPS_PROXY="http://10.0.0.1:3128"~
|
|||||||
|
|
||||||
Ajoute les annotations Gemini aux copies, enregistrées dans le dossier =Anot=.
|
Ajoute les annotations Gemini aux copies, enregistrées dans le dossier =Anot=.
|
||||||
On peut passer l'argument =--overwrite=.
|
On peut passer l'argument =--overwrite=.
|
||||||
|
OU
|
||||||
2. =python annotating_with_checks.py Interro=
|
2. =python annotating_with_checks.py Interro=
|
||||||
|
|
||||||
Ajoute les annotations Gemini, et des checkboxes à cocher.
|
Ajoute les annotations Gemini, et des checkboxes à cocher.
|
||||||
@@ -257,27 +256,24 @@ OU
|
|||||||
|
|
||||||
_Needs_ : label_groups file (made automatically by this function),
|
_Needs_ : label_groups file (made automatically by this function),
|
||||||
qui dit quelles questions regrouper.
|
qui dit quelles questions regrouper.
|
||||||
|
3. =python export.py Interro= (gestion perso)
|
||||||
|
Cela déplace les groupes dans le dossier configuré par =EXPORT_DIR=
|
||||||
3. =python to_tablette.py Interro= (gestion perso)
|
(par défaut =Export=).
|
||||||
Cela déplace les groupes dans =SyncCopies/À Annoter=.
|
|
||||||
- Les mettre dans le dossier racine de la tablette, et renommer en =aaa=.
|
- Les mettre dans le dossier racine de la tablette, et renommer en =aaa=.
|
||||||
- Vider =Syncthing/Annotées= sur la tablette et localement.
|
- Vider =Syncthing/Annotées= sur la tablette et localement.
|
||||||
À automatiser, aussi c'est lent…
|
À automatiser, aussi c'est lent…
|
||||||
|
|
||||||
** Lecture de la correction manuscrite
|
** Lecture de la correction manuscrite
|
||||||
|
|
||||||
1. =python from_tablette.py Interro= (gestion perso)
|
1. =python import.py Interro= (gestion perso)
|
||||||
|
|
||||||
_Before_ : delete =~/SyncCopies/Annotées=, copy or sync from the
|
_Before_ : vider le dossier configuré par =IMPORT_DIR= (par défaut
|
||||||
tablette to here.
|
=Import=), puis y copier ou synchroniser les fichiers depuis la tablette.
|
||||||
|
|
||||||
Une fois les corrections manuelles appliquées aux fichiers
|
Une fois les corrections manuelles appliquées aux fichiers
|
||||||
=Concat.pdf=, il faut enregistrer le fichier annoté au même endroit,
|
=Concat.pdf=, il faut enregistrer le fichier annoté au même endroit,
|
||||||
sous le nom =Concat_annotated.pdf=.
|
sous le nom =Concat_annotated.pdf=.
|
||||||
|
|
||||||
(À faire : universaliser =to_tablette.py= et =from_tablette.py=)
|
|
||||||
|
|
||||||
2. =python reading_annotations.py Interro=
|
2. =python reading_annotations.py Interro=
|
||||||
|
|
||||||
Lit les =Concat_annotated= dans =Bnot=, regénère les copies avec
|
Lit les =Concat_annotated= dans =Bnot=, regénère les copies avec
|
||||||
@@ -332,8 +328,8 @@ groupée into refaire !!
|
|||||||
4. ?? Si je fais refaire, avant d'avoir créer les annotating with
|
4. ?? Si je fais refaire, avant d'avoir créer les annotating with
|
||||||
checks, que se passe-t-il ???
|
checks, que se passe-t-il ???
|
||||||
5. Appeler =annotating_with_checks.py --refaire --overwrite=
|
5. Appeler =annotating_with_checks.py --refaire --overwrite=
|
||||||
6. =python to_tablette.py --refaire Interro24=
|
6. =python export.py --refaire Interro24=
|
||||||
6. =python from_tablette.py --refaire Interro24=
|
6. =python import.py --refaire Interro24=
|
||||||
7. =python reading_grouped_annotations.py --refaire Interro24=
|
7. =python reading_grouped_annotations.py --refaire Interro24=
|
||||||
|
|
||||||
** Exemple de replotting, refaire d'une copie
|
** Exemple de replotting, refaire d'une copie
|
||||||
@@ -345,4 +341,4 @@ groupée into refaire !!
|
|||||||
3. Make `refaire.json`, avec la copie, et les labels à refaire.
|
3. Make `refaire.json`, avec la copie, et les labels à refaire.
|
||||||
4. `python correction.py DS09VA --refaire`
|
4. `python correction.py DS09VA --refaire`
|
||||||
5. `python annotating_with_checks.py DS09VA --refaire`
|
5. `python annotating_with_checks.py DS09VA --refaire`
|
||||||
6. `python from_tablette.py Interro24 --refaire`
|
6. `python import.py Interro24 --refaire`
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
API_KEY = os.environ.get("GEMINI_API_KEY")
|
API_KEY = os.environ.get("GEMINI_API_KEY")
|
||||||
|
|
||||||
|
EXPORT_DIR = Path("Export")
|
||||||
|
IMPORT_DIR = Path("Import")
|
||||||
|
|
||||||
# Modèle pour des choses très légères
|
# Modèle pour des choses très légères
|
||||||
MODEL_LITE_ID = "gemini-3.5-flash-lite"
|
MODEL_LITE_ID = "gemini-3.5-flash-lite"
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ import sys
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from config import EXPORT_DIR
|
||||||
|
|
||||||
def process_directory(dir_arg):
|
def process_directory(dir_arg):
|
||||||
# Résolution des chemins
|
# Résolution des chemins
|
||||||
base_dir = Path(dir_arg)
|
base_dir = Path(dir_arg)
|
||||||
bgnot_dir = base_dir / "BGnot"
|
bgnot_dir = base_dir / "BGnot"
|
||||||
sync_dir = Path.home() / "SyncCopies" / "À Annoter" / dir_arg
|
sync_dir = EXPORT_DIR / dir_arg
|
||||||
|
|
||||||
# Création du dossier de destination s'il n'existe pas
|
# Création du dossier de destination s'il n'existe pas
|
||||||
sync_dir.mkdir(parents=True, exist_ok=True)
|
sync_dir.mkdir(parents=True, exist_ok=True)
|
||||||
@@ -57,7 +59,7 @@ if __name__ == "__main__":
|
|||||||
if args.refaire:
|
if args.refaire:
|
||||||
base_dir = Path(root_dir)
|
base_dir = Path(root_dir)
|
||||||
brnot_dir = base_dir / "BRnot"
|
brnot_dir = base_dir / "BRnot"
|
||||||
sync_dir = Path.home() / "SyncCopies" / "À Annoter" / root_dir
|
sync_dir = EXPORT_DIR / root_dir
|
||||||
sync_dir.mkdir(parents=True, exist_ok=True)
|
sync_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
for f in brnot_dir.iterdir():
|
for f in brnot_dir.iterdir():
|
||||||
@@ -2,13 +2,15 @@ import sys
|
|||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from config import IMPORT_DIR
|
||||||
|
|
||||||
def sync_annotated(dir_arg, refaire):
|
def sync_annotated(dir_arg, refaire):
|
||||||
if not refaire:
|
if not refaire:
|
||||||
bgnot_dir = Path(dir_arg) / "BGnot"
|
bgnot_dir = Path(dir_arg) / "BGnot"
|
||||||
else:
|
else:
|
||||||
bgnot_dir = Path(dir_arg) / "BRnot"
|
bgnot_dir = Path(dir_arg) / "BRnot"
|
||||||
|
|
||||||
annotated_dir = Path.home() / "SyncCopies" / "Annotées"
|
annotated_dir = IMPORT_DIR
|
||||||
|
|
||||||
if not annotated_dir.is_dir():
|
if not annotated_dir.is_dir():
|
||||||
print(f"Error: Directory {annotated_dir} does not exist.")
|
print(f"Error: Directory {annotated_dir} does not exist.")
|
||||||
Reference in New Issue
Block a user