Metadata-Version: 2.4
Name: iints-sdk-python35
Version: 1.5.4
Summary: A pre-clinical Edge-AI SDK for diabetes management validation.
Author-email: Rune Bobbaers <rune.bobbaers@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/python35/IINTS-SDK
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
License-File: LICENSE-MIT-IINTS-LEGACY
Requires-Dist: fastapi>=0.115.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: PyYAML
Requires-Dist: rich>=12.0.0
Requires-Dist: scipy>=1.9.0
Requires-Dist: typer[all]
Requires-Dist: uvicorn>=0.30.0
Provides-Extra: edge
Requires-Dist: pyserial>=3.5; extra == "edge"
Provides-Extra: reports
Requires-Dist: fpdf2>=2.8.0; extra == "reports"
Requires-Dist: matplotlib>=3.5.0; extra == "reports"
Requires-Dist: openpyxl>=3.0.0; extra == "reports"
Requires-Dist: pillow>=12.1.1; extra == "reports"
Requires-Dist: seaborn>=0.11.0; extra == "reports"
Provides-Extra: full
Requires-Dist: fpdf2>=2.8.0; extra == "full"
Requires-Dist: matplotlib>=3.5.0; extra == "full"
Requires-Dist: openpyxl>=3.0.0; extra == "full"
Requires-Dist: pyserial>=3.5; extra == "full"
Requires-Dist: pillow>=12.1.1; extra == "full"
Requires-Dist: seaborn>=0.11.0; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: hypothesis>=6.0.0; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pandas-stubs; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Requires-Dist: types-psutil; extra == "dev"
Provides-Extra: torch
Requires-Dist: torch>=1.9.0; extra == "torch"
Provides-Extra: nightscout
Requires-Dist: py-nightscout; extra == "nightscout"
Provides-Extra: research
Requires-Dist: torch>=2.0.0; extra == "research"
Requires-Dist: pyarrow>=12.0.0; extra == "research"
Requires-Dist: h5py>=3.10.0; extra == "research"
Requires-Dist: onnx>=1.16.0; extra == "research"
Requires-Dist: onnxscript>=0.1.0; extra == "research"
Provides-Extra: mdmp
Requires-Dist: cryptography>=42.0.0; extra == "mdmp"
Dynamic: license-file

# IINTS-AF SDK
[![EUCYS 2026](https://img.shields.io/badge/EUCYS-2026%20Selected-gold?style=flat)](https://eucys.eu)
[![PyPI version](https://badge.fury.io/py/iints-sdk-python35.svg)](https://badge.fury.io/py/iints-sdk-python35)
[![Python Package CI](https://github.com/python35/IINTS-SDK/actions/workflows/python-package.yml/badge.svg)](https://github.com/python35/IINTS-SDK/actions/workflows/python-package.yml)
[![Docs](https://img.shields.io/badge/docs-IINTS--AF-0a66c2?style=flat&logo=firefox-browser&logoColor=white)](https://python35.github.io/IINTS-SDK/)

> "Code shouldn't be a secret when it's managing a life."

Insulin pumps make hundreds of autonomous decisions about drug delivery every day.  
The algorithms behind those decisions are proprietary, unauditable, and difficult to inspect or improve, even by the patients whose lives depend on them.

IINTS-AF is an open-source research platform that changes that.

## Core Research Question

**Can open-source simulation and deterministic safety supervision make insulin delivery algorithm development safer and more transparent for researchers and patients?**

---

## What It Does

**Simulate:** Run virtual patients through thousands of scenarios before any algorithm reaches a real device. A deterministic safety supervisor audits every AI decision. The AI may suggest. The supervisor decides.

**Certify:** Every dataset is fingerprinted and graded before it touches a study workflow. The goal is to keep benchmark inputs traceable, reviewable, and reproducible.

**Understand:** Generate audit-ready reports, visual posters, and local AI summaries from the same study bundle. IINTS-AF can use local models such as Ministral for explanation workflows on your own hardware.

---

## Research Results

Final locked benchmark: `3600` simulation runs, `6` profiles, `4` scenario families, `5` algorithms, `10` fixed seeds.

| Metric | ExampleAlgorithm | PID Baseline | Delta |
|---|---:|---:|---:|
| Time in Range | 87.16% | 83.72% | +3.44% |
| Time < 70 mg/dL | 1.28% | 5.25% | -3.97% |
| Supervisor interventions | 99 | 177 | -78 |

Additional benchmark result:
- clean certified conditions showed `+17.64` Time-in-Range points versus corrupted uncertified conditions

For the full scientific write-up, see:
- `research/EUCYS_REPORT.md`
- `research/EUCYS_REPORT.pdf`
- `results/eucys_2026/EUCYS_RESULTS/EUCYS_SUMMARY.md`

---

## Install

```bash
python3 -m venv .venv && source .venv/bin/activate
pip install -U "iints-sdk-python35[full,mdmp]"
iints doctor --smoke-run
```

**Edge devices (Raspberry Pi 5, Arduino UNO Q):**

```bash
pip install -U "iints-sdk-python35[edge,mdmp]"
```

---

## Quick Start

```bash
iints quickstart --project-name my_study
cd my_study
iints presets run --name baseline_t1d --algo algorithms/example_algorithm.py
iints data certify contracts/clinical_mdmp_contract.yaml data/demo/diabetes_cgm.csv --output-json audit/certification.json
iints ai report results/<run_id>
```

---

## Final Benchmark Workflow

```bash
tools/research/run_eucys_final.sh \
  --algo algorithms/example_algorithm.py \
  --output-dir results/eucys_2026 \
  --seeds 1,2,3,4,5,6,7,8,9,10
```

Then render the report:

```bash
tools/research/render_eucys_report_pdf.sh
```

Main final artifacts:
- `results/eucys_2026/`
- `results/eucys_2026/EUCYS_RESULTS/EUCYS_MAIN_FIGURE.png`
- `results/eucys_2026/EUCYS_RESULTS/EUCYS_RESULTS_TABLE.csv`
- `research/EUCYS_REPORT.md`
- `research/EUCYS_REPORT.pdf`

---

## Live Digital Patient (Raspberry Pi)

```bash
iints patient start \
  --algo algorithms/example_algorithm.py \
  --scenario-profile expo_hot_start \
  --mode demo-time --speed 60x
```

Open `http://127.0.0.1:8765/dashboard`. You will see a virtual patient running continuously, reacting to meals, exercise, and sleep in real time.

---

## Documentation

| | |
|---|---|
| Getting started | [Open guide](https://python35.github.io/IINTS-SDK/GETTING_STARTED/) |
| Edge hardware | [Open guide](https://python35.github.io/IINTS-SDK/EDGE_HARDWARE/) |
| Raspberry Pi setup | [Open guide](https://python35.github.io/IINTS-SDK/DIGITAL_PATIENT_PI/) |
| Data certification | [Open guide](https://python35.github.io/IINTS-SDK/MDMP_QUICKSTART/) |
| Full manual | [Open PDF manual](https://python35.github.io/IINTS-SDK/manuals/IINTS-AF_SDK_Manual.pdf) |
| Research report | [Open report source](research/EUCYS_REPORT.md) |

---

> IINTS-AF is research software. Not a medical device.  
> No clinical dosing advice. MIT Licensed.

---

*Built by a 17-year-old with type 1 diabetes who wanted to 
understand the device managing his life.*
