Skip to main content

STI modelling toolbox built on the Starsim platform

Project description

STIsim

tests PyPI

STIsim is an agent-based modeling framework in which users can design and configure simulations of co-circulating sexually-transmitted diseases. STIsim uses the Starsim architecture, and belongs to the Starsim model suite which also includes Covasim, HPVsim, and FPsim.

Requirements

Python 3.9-3.14 or R.

We recommend, but do not require, installing STIsim in a virtual environment, such as Miniconda.

Installation

Python

STIsim is most easily installed via PyPI:

pip install stisim

Or with uv:

uv init example
cd example
uv add stisim

STIsim can also be installed locally (including optional dependencies for testing and documentation). To do this, clone first this repository, then run:

pip install -e .[dev]

R

STIsim can be used from R via rstarsim, which calls the Python engine through reticulate. The Python packages are required regardless of whether you use the R or Python interface.

Install the R packages:

install.packages(c("reticulate", "devtools"))
devtools::install_github("starsimhub/rstarsim")

On first use, rstarsim will set up a conda environment automatically if needed. To use an existing environment instead:

library(starsim)
load_starsim("my_env_name")

See r.starsim.org for more information on using Starsim from R.

Usage and documentation

Documentation, including tutorials and a user guide, is available at https://docs.stisim.org. Additional resources:

  1. The examples below show how to set up, calibrate, and run country-level models
  2. Read the articles that have been published about analyses using STIsim (see references below)
  3. Email us: info@starsim.org

Development roadmap

The roadmap for future model development can be viewed here.

References

Publications using STIsim include:

  1. Reduction in overtreatment of gonorrhoea and chlamydia through point-of-care testing cmpared with syndromic management for vaginal discharge: a modelling study for Zimbabwe (2026). Stuart RM, Newman LM, Manguro G, Dziva Chikwari C, Marks M, Peters RPH, Klein D, Snyder L, Kerr C, Rao DW. Sex Transm Infect https://doi.org/10.1136/sextrans-2025-056646. Preprint: https://doi.org/10.21203/rs.3.rs-8843262/v1

  2. Point-of-care testing to strengthen sexually transmitted infection case management in resource-constrained settings (2026). Peters RPH, Manguro G, Ong'wen PA, Mdingi MM, Applegate TL, Stuart R, Harding-Esch EM, Manabe YC, Ndowa F, Van Der Pol B. Sex Transm Infect, https://doi.org/10.1136/sextrans-2025-056833.

Examples

The following repositories contain end-to-end analyses built with STIsim, and are a good starting point for understanding how to set up, calibrate, and run country-level models:

  • hiv_kenya -- HIV transmission model for Kenya with structured sexual networks, testing (FSW-targeted and general population), ART, and PrEP. Includes both Python and R interfaces and Optuna-based calibration.
  • hiv_zambia -- HIV transmission model for Zambia. Similar structure to the Kenya model, useful for comparing how the same framework is adapted to a different country context.
  • stisim_vddx_zim -- Multi-STI model (gonorrhea, chlamydia, trichomoniasis, BV) for Zimbabwe evaluating point-of-care diagnostics vs. syndromic management for vaginal discharge. Demonstrates co-circulating STIs, intervention comparison, and scenario analysis.
  • syph_dx_zim -- Joint HIV-syphilis model for Zimbabwe evaluating syphilis diagnostic algorithms. Features coinfection connectors, stage-specific syphilis transmission, congenital syphilis, and treatment pathway analysis.
  • hiv_vmb_southafrica -- HIV-vaginal microbiome transmission model calibrated to South Africa. This model was developed to evaluate novel products to shift the vaginal microbiome and their impact on HIV and pre-term birth.

Contributing

We welcome all contributions to STIsim! Please refer to our code of conduct and contributors's guide. You'll find information there about our style guide, which is essential reading prior to contributing. Questions or comments can be directed to info@starsim.org, or on this project's GitHub page.

See .github/workflows/README.md for details on publishing new releases of STIsim.

Disclaimer

The code in this repository was developed by IDM, the Burnet Institute, and other collaborators to support our joint research on flexible agent-based modeling. We've made it publicly available under the MIT License to provide others with a better understanding of our research and an opportunity to build upon it for their own work. We make no representations that the code works as intended or that we will provide support, address issues that are found, or accept pull requests. You are welcome to create your own fork and modify the code to suit your own modeling needs as permitted under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stisim-1.5.0.tar.gz (317.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stisim-1.5.0-py3-none-any.whl (123.4 kB view details)

Uploaded Python 3

File details

Details for the file stisim-1.5.0.tar.gz.

File metadata

  • Download URL: stisim-1.5.0.tar.gz
  • Upload date:
  • Size: 317.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for stisim-1.5.0.tar.gz
Algorithm Hash digest
SHA256 cdb4d05cfc9e8adab7c0e68db1bcae3166ae4ca6bf44155b9932c17a6a059419
MD5 a4f2a529123b3e0e710da99575a02bee
BLAKE2b-256 a2e4f752f3ab72e993d8eae312be19010ca74cc51e7bfdd9e9b746e4627df093

See more details on using hashes here.

File details

Details for the file stisim-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: stisim-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 123.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for stisim-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b679b3de5799c737a46b074e7c32ecc92e7fa8cac8b5a067e9b67e310cdb5e45
MD5 9b513ba49cdfd5be4b0448eb995a2cd9
BLAKE2b-256 f6fd882773ea20093ee0e0e36f693630a900e33ec16657686ff45305a59a55b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page