more robust import script

This commit is contained in:
2026-07-17 19:43:19 +02:00
parent 9d30359602
commit 64f1993a84
7 changed files with 175 additions and 13 deletions
+20 -1
View File
@@ -52,7 +52,26 @@ Preview an import without changing the database:
python scripts/import_excel.py /path/to/fatima.xlsx
```
Add `--apply` to import. The command backs up the existing SQLite file before updating it.
The preview prints the absolute workbook and database paths, current database
row counts and date range, discovered workbook values, and overwrite counts.
Check that the printed database path is the same file used by the production
app before applying the import.
Add `--apply` to import:
```sh
python scripts/import_excel.py /path/to/fatima.xlsx --apply
```
The importer refuses to write if the database is missing, has the wrong schema,
or the workbook contains no importable data. It creates a consistent SQLite
backup before writing, reads every imported value back after committing, and
prints the final row counts and date range. If production uses a non-default
database location, specify it explicitly:
```sh
python scripts/import_excel.py /path/to/fatima.xlsx --database /absolute/path/calendar.sqlite --apply
```
On the iPhone, visit `http://<your-computer-on-the-local-network>:9009/fatima/`.
Waitress listens on all network interfaces with the command above. For anything