Every report section now gets its own landscape A4 page (or, for Dagoverzicht, one page per day) via a GlucoseReportPDF(FPDF) subclass with a real header (section title, report version, insulin/pump/sensor type from new REPORT_* env vars) and footer (page number, generation timestamp, Nightscout link) on every page, plus an original SVG icon in the header — inspired by the LibreView AGP report. New "Insulineprofiel" PDF section mirrors the dashboard page (basal bar chart, ISF/carb-ratio segments, DIA). Each Dagoverzicht day now draws the same basal/bolus/carb/target overlays as the interactive charts (matplotlib port of the Plotly helpers from #30) plus a new per-day stats block (reporting.daily_stats: avg/min/max glucose, total/basal/bolus/SMB insulin, hypo/hyper counts and durations). Builds on #29 (profile data) and #30 (overlay logic/colors).
44 lines
1.5 KiB
Markdown
44 lines
1.5 KiB
Markdown
# glucose-dashboard
|
|
|
|
Dashboard van glucosedata, live opgehaald uit een [Nightscout](https://nightscout.github.io/)-instantie.
|
|
Meerdere pagina's (zie zijbalk): een rollend live-overzicht en een set
|
|
klinische rapportagepagina's (zie `docs/requirements-reporting.md` en
|
|
`docs/design-reporting.md`).
|
|
|
|
## Instellen
|
|
|
|
1. Zorg voor een draaiende Nightscout-instantie en een API-token (Admin Tools
|
|
> Manage Tokens in Nightscout — geef het token minimaal `readable`-rechten)
|
|
of het klassieke API secret.
|
|
2. Kopieer `.env.example` naar `.env` en vul `NIGHTSCOUT_URL`, één van de
|
|
twee auth-opties, en `DASHBOARD_PASSWORD_HASH` in (zie het voorbeeldbestand
|
|
voor hoe je die hash genereert — de dashboard-URL wordt gedeeld met het
|
|
diabetesteam, dus elke pagina zit achter een wachtwoord). `app.py` laadt
|
|
`.env` zelf in (via `python-dotenv`), dus dit werkt hetzelfde onder
|
|
PowerShell, cmd of bash — je hoeft de variabelen niet zelf in je shell te
|
|
zetten. `REPORT_INSULIN_TYPE`/`REPORT_PUMP_TYPE`/`REPORT_SENSOR_TYPE` zijn
|
|
optioneel en puur informatief (getoond in de kop van het PDF-rapport).
|
|
3. Lokaal draaien:
|
|
|
|
```powershell
|
|
uv venv
|
|
uv pip install -r requirements.txt --python .venv
|
|
.venv\Scripts\streamlit run app.py
|
|
```
|
|
|
|
4. Met Docker Compose:
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
`docker-compose.yml` leest `.env` via `env_file` — dat bestand wordt niet
|
|
meegecommit (zie `.gitignore`).
|
|
|
|
## Tests en lint
|
|
|
|
```bash
|
|
pytest tests/ -v
|
|
ruff check .
|
|
```
|