From c6a7b139a3cd60c1f790b0c058f10a4819d6902e Mon Sep 17 00:00:00 2001 From: anthony-melin Date: Tue, 19 May 2026 23:43:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20doc=20pydantic=20character=20bui?= =?UTF-8?q?lder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ca9e78..108128f 100644 --- a/README.md +++ b/README.md @@ -71,4 +71,32 @@ Pour exécuter ce projet, vous aurez besoin de Python 3.7 ou supérieur. ```bash python3 app.py -``` \ No newline at end of file +``` + +## Personnalisation du CharacterBuilder + +Le `CharacterBuilder` peut être personnalisé pour utiliser différentes implémentations de sauvegarde et de chargement selon vos besoins. +Cette personnalisation se fait simplement en définissant une variable d'environnement avant de lancer votre script Python. + +### Variable d'environnement : `ELIRON_BUILDER` + +- **Nom** : `ELIRON_BUILDER` +- **Valeur possible** : + - `"pydantic"` : Utilise des implementations basées sur `pydantic`. + - Toute autre valeur ou absence de variable : Utilise les fonctions par défaut. + +> ⚠️ **Important** : Pour utiliser le builder pydantic, vous devez avoir installé le package `pydantic` au préalable : +> ```bash +> pip install pydantic +> ``` + +### Exemple d'utilisation sous Linux / macOS + +```bash +# Pour utiliser l'implémentation pydantic +export ELIRON_BUILDER=pydantic +python app.py + +# Pour utiliser l'implémentation par defaut +unset ELIRON_BUILDER +python app.py