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