Add bulk CSV import script for work entries
- Add scripts/import_csv.py for direct SQLite database import - Handle date conflicts with warnings (existing data preserved) - Support multiple time slots per entry (semicolon-separated) - Validate day_type, journey_profile_id, and motor_vehicle_id - Update README.md with usage instructions
This commit is contained in:
21
README.md
21
README.md
@@ -74,6 +74,27 @@ Toute la configuration métier se trouve dans `config.toml` :
|
||||
.venv/bin/python -m pytest
|
||||
```
|
||||
|
||||
### Import bulk depuis CSV
|
||||
|
||||
Un script est disponible pour importer des entrées en masse depuis un fichier CSV :
|
||||
|
||||
```bash
|
||||
# Format du CSV : date,day_type,journey_profile_id,motor_vehicle_id,start_time,end_time,comment
|
||||
# Exemple :
|
||||
# 2025-06-02,WORK,moteur_seul,familiale,09:00;14:00,17:45;12:00,Travail normal
|
||||
# 2025-06-03,TT,,,09:00,17:45,Télétravail
|
||||
|
||||
.venv/bin/python scripts/import_csv.py mon_fichier.csv
|
||||
|
||||
# Avec une config personnalisée
|
||||
.venv/bin/python scripts/import_csv.py mon_fichier.csv --config /chemin/vers/config.toml
|
||||
```
|
||||
|
||||
**Comportement :**
|
||||
- En cas de conflit sur une date, les données existantes sont conservées et un avertissement est affiché
|
||||
- Les plages horaires multiples peuvent être séparées par des points-virgules (`;`)
|
||||
- Types de jour valides : WORK, TT, GARDE, ASTREINTE, FORMATION, RTT, CONGE, MALADE, FERIE
|
||||
|
||||
## Licence
|
||||
|
||||
[MIT](LICENSE.md) — Copyright (c) 2026 Antoine Van-Elstraete
|
||||
|
||||
Reference in New Issue
Block a user