**✅ DASHBOARD BOLLETTA GAS (HTML + JS + PHP + Python integrato)** --- ### 1. `index.html` (UI della dashboard) ```html Estrai dati bolletta GAS

Carica bolletta GAS (.docx)

``` --- ### 2. `estrai_bolletta.php` (gestione upload + esecuzione Python) ```php Risultati estratti:"; } ?> ``` --- ### 3. `estrai_bolletta.py` (lettura e parsing del .docx) ```python import sys, json from docx import Document doc = Document(sys.argv[1]) text = "\n".join([p.text for p in doc.paragraphs]) risultati = { "Materia gas": "", "Trasporto": "", "Oneri sistema": "", "Imposte": "" } for line in text.splitlines(): line_low = line.lower() if "materia gas" in line_low: risultati["Materia gas"] = line.split("€")[-1].strip() elif "trasporto" in line_low: risultati["Trasporto"] = line.split("€")[-1].strip() elif "oneri" in line_low: risultati["Oneri sistema"] = line.split("€")[-1].strip() elif "imposte" in line_low: risultati["Imposte"] = line.split("€")[-1].strip() print(json.dumps(risultati)) ``` --- ### 📦 Requisiti: - PHP installato - Python 3 + `python-docx` (`pip install python-docx`) - Server Apache o simili (XAMPP, MAMP, ecc.) --- Fammi sapere se vuoi: - aggiungere un confronto automatico con grafico - salvare gli storici - integrare le tariffe ARERA da fonte ufficiale