Python tool to import Medifox Excel exports, keep a synchronized SQLite customer/contact phonebook, and export an active telephone list as CSV.
- Reads Excel files exported from Medifox
- Tkinter desktop menu (default launcher)
- Terminal menu fallback if Tkinter cannot start
- Detects sheet type automatically (currently
medifox_reportand generic tabular format) - Stores unique customers with:
- name
- firstname
- pflegegrad
- phone
- mobile
- Stores multiple contacts per customer with:
- contact_name
- contact_firstname
- contact_relation
- contact_phone
- contact_mobile
- Synchronizes active status on every import batch:
- customer in Excel -> active
- customer missing from current Excel batch -> inactive
- Search by phone number (customer and contacts)
- Export active phone list to CSV
- Export deduplicated HalloLena single-phone CSV
- Dedicated
uploads/folder workflow for Excel imports
-
Create and activate virtual environment:
PowerShell:
py -3 -m venv .venv .\.venv\Scripts\Activate.ps1
-
Install dependencies:
pip install -e . -
Run:
python src/main.py
or after install:
```powershell
medifox-phonebook
- If Tkinter cannot start, the app falls back to terminal mode automatically.
- Put export files into
uploads/. - In the GUI, use one of these options:
- Import All From uploads
- Select From uploads And Import
- Add File(s) And Import
- The import sync logic sets
active = 1for customers in the import batch andactive = 0for customers not in the current batch.
- Import all Excel files from uploads folder
- Select files from uploads folder and import
- Add file(s) to uploads and import directly
- Search by phone number
- Export active telephone list CSV
- Export HalloLena single phone list CSV
- Show DB stats
- File content is flattened to one person-phone per row (customers and contacts).
- Duplicate rows are removed.
- Output columns are:
phone_e164first_namelast_nameemail(currently empty)
Example header:
"phone_e164","first_name","last_name","email"A suggested next step if you want a larger maintainable structure:
pu_excel_to_csv/
src/
main.py
phonebook/
__init__.py
cli.py
db.py
parsers/
__init__.py
medifox_report.py
tabular.py
models.py
exporter.py
pyproject.toml
README.md
AGENTS.md
ROADMAP.md
tests/
test_parsers.py
test_sync.py
- SQLite DB is created automatically as
phonebook.dbin the project root. uploads/andphonebook.dbare git-ignored.
- Sheet categorization is heuristic-based and can be extended for additional Medifox export variants.
- If your export layout differs, add parser rules in
src/main.py(or split into parser modules as per scaffold).