AnaSim
AnaSim is an adult anesthesia simulator for teaching and research. It runs published drug and cardiorespiratory models in real time, with a patient monitor and anesthesia machine interface.
Run AnaSim
Open robche.com/AnaSim in your browser.
To run locally, install with Python 3.10 or later.
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install anasim-simulator
anasim
anasim opens a local browser session and works offline. Stop the server with Ctrl+C.
Use a session
For a first session, choose Guided scenario and TIVA induction. For open practice, choose Open simulation and either Awake before induction or Anesthetized maintenance. Choose Start simulation, then Start below the monitor.
Manual infusion rates are the default. Select Allow TCI during setup to use target controls and TCI maintenance starts. Scenario instructions follow this setting. Propofol and remifentanil rates use mcg/kg/min.
Use Apply or Enter to save settings and Escape to cancel edits. For mechanical ventilation, select a facemask or tracheal tube, apply a mode, and choose Start ventilator.
Local CSV recordings go to recordings/ where you launched anasim;
hosted recordings download when stopped.
Features
- Drugs include propofol, remifentanil, fentanyl, midazolam, etomidate, ketamine, lidocaine, sevoflurane, rocuronium, sugammadex, norepinephrine, epinephrine, phenylephrine, vasopressin, dobutamine, milrinone, esmolol, labetalol, and glycopyrrolate. Delivery includes bolus, infusion, and effect-site target-controlled infusion (TCI) where supported.
- Machine options include a facemask or tracheal tube, fresh gas flow, a vaporizer, bag-mask ventilation, and VCV, PCV, PCV-VG, SIMV, PSV, or CPAP.
- The monitor shows ECG, SpO₂, arterial pressure, NIBP, capnography, ventilation waveforms and loops, gas values, BIS, TOF, temperature, fluid balance, and alarms.
- Events include fluids and blood, surgical stimulation, airway obstruction, bronchospasm, laryngospasm, hemorrhage, anaphylaxis, sepsis, and arrhythmias.
- Guided scenarios cover TIVA and inhalational induction and emergence, hemorrhage, anaphylaxis, septic shock, and oxygen supply failure.
Limits
AnaSim supports adults aged 18 to 70 years, with input limits. Architecture describes source populations and teaching calibrations. Acid-base balance, lactate, tissue oxygen debt, machine pneumatics, and CPR are not modeled.
Headless use
anasim --mode headless --duration 60 --record
Documentation
| Task | Guide |
|---|---|
| Configure patients, run scripts, or interpret CSV | CLI and Python usage |
| Understand model behavior and assumptions | Architecture |
| Find the source studies | Model references |
| Change the code and choose checks | Contributing |
| Review release changes | Changelog |
Citation and license
Cite using CITATION.cff.
Licensed under MIT.
The first TIVA implementation was derived from
Python Anesthesia Simulator.
Metadata
Release files for anasim-simulator 1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anasim_simulator-1.4.tar.gz | 214.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anasim_simulator-1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 399.2 kB
Release files / anasim_simulator-1.4.tar.gz
| Download URL | anasim_simulator-1.4.tar.gz |
|---|---|
| Size | 214.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a66e37eb4ab2cd104157efa4841f5b708a06ff20c98cd1f76bf4773ded28636
|
|
BLAKE2b-256 checksum How to use checksums |
7f68cebefb5b325fa8b9ce98360cae4438999933ffcfc1ff5808ce80451d101a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency logRelease files / anasim_simulator-1.4-py3-none-any.whl
| Download URL | anasim_simulator-1.4-py3-none-any.whl |
|---|---|
| Size | 184.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8033a1e1c295427ac4e9cc00b2238b0866c7a2a3c7279f17b188b5699bbb2cb8
|
|
BLAKE2b-256 checksum How to use checksums |
19ef75e244ab078be9778edc94ba3c6fd90eb1190d9f93cde9c3e2ba205411c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.
Transparency log