Skip to main content

Human papillomavirus simulator (HPVsim)

PyPI version Tests

About HPVsim

HPVsim is a flexible agent-based model for simulation HPV transmission and progression through cervical disease to cancer. The model can be parameterized with country-specific vital dynamics, structured sexual networks, co-transmitting HPV genotypes, B- and T-cell mediated immunity, and high-resolution disease natural history. HPVsim is designed with a user-first lens: it is implemented in pure Python, has built-in tools for simulating commonly-used interventions, has been extensively tested and documented, and runs in a matter of seconds to minutes on a laptop.

Version 3.0 of HPVsim is built on the Starsim modeling architecture. This is a significant shift from the v2 series: the disease model, sexual network, demographics, interventions, and analyzers are now Starsim modules, and the API changed accordingly. The science is preserved — see the migration guide for a full v2→v3 walkthrough. The v2 series is frozen aside from critical bugfixes.

The scientific paper describing HPVsim is available at https://doi.org/10.1371/journal.pcbi.1012181. The recommended citation is:

HPVsim: An agent-based model of HPV transmission and cervical disease (2024). Stuart RM, Cohen JA, Kerr CC, Mathur P , NDMC India, Zimmermann M, Rao DW, Boudreau MC, Lee S, Yang L, Klein DJ. PLOS Computational Biology 20(7): e1012181. https://doi.org/10.1371/journal.pcbi.1012181

Background

HPVsim has been used for analyses in several countries. Academic papers that have been written using HPVsim include:

  1. Inferring the natural history of HPV from global cancer registries: insights from a multi-country calibration (2024). Stuart RM, Cohen JA, Abeysuriya RG, Sanz-Leon P, Kerr CC, Rao DW, Klein DJ. Sci Rep 14, 15875. https://doi.org/10.1038/s41598-024-65842-3
  2. HPV DNA Screening and Vaccination Strategies in Tunisia (2025). Lahdhiri A, Benzina B, Ennaifer E, Tounsi H, Gzara A, Rammeh-Rommani S, Laraj O, Arfaoui H, Stuart RM Kebir, A, BenMiled S (2025). Sci Rep, forthcoming.
  3. Can pruning improve agent-based models’ calibration? An application to HPVsim (2025). Sturman F, Swallow B, Kerr CC, Stuart RM, Panovska-Griffiths J. Journal of Theoretical Biology, forthcoming.

Installation

The easiest way to install is simply via pip: pip install hpvsim. Alternatively, you can clone this repository, then run pip install -e . (don't forget the dot!) in this folder to install hpvsim and its dependencies. This will make hpvsim available on the Python path. The first time HPVsim is imported, it will automatically download the required data files (~30 MB). You can also download the data manually by running hpvsim-download-data from the terminal.

Usage and documentation

Documentation is available at https://docs.hpvsim.org, including tutorials. Additional usage examples are available in the examples folder.

Contributing

If you wish to contribute, please follow the Starsim style guide at: https://github.com/starsimhub/styleguide. See the code of conduct readme for more information.

Disclaimer

The code in this repository was developed by IDM, the Burnet Institute, and other collaborators to support our joint research on HPV. 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. Note that HPVsim depends on a number of user-installed Python packages that can be installed automatically via pip install. 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 contemplated under the MIT License.

Download files

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

Source Distribution

hpvsim-3.0.0.tar.gz (524.8 kB view details)

Uploaded Source

Built Distribution

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

hpvsim-3.0.0-py3-none-any.whl (159.6 kB view details)

Uploaded Python 3

File details

Details for the file hpvsim-3.0.0.tar.gz.

File metadata

  • Download URL: hpvsim-3.0.0.tar.gz
  • Upload date:
  • Size: 524.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hpvsim-3.0.0.tar.gz
Algorithm Hash digest
SHA256 6ae8f45b00af613d9f0b989cfa30fa0f0d186cbc16a03e8b1fca38f79443922a
MD5 bf6512fe4bc8b8bc47bcfbd7b3c12ff2
BLAKE2b-256 8b82b1f865acac68116bb246194d1d90093814989554b1add958c62b9bd20c67

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpvsim-3.0.0.tar.gz:

Publisher: pypi_release.yaml on starsimhub/hpvsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hpvsim-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: hpvsim-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 159.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hpvsim-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69787a3bf3e24648440d0008fba226569dd160f85697b9aa6f887b3a65b1c1ca
MD5 4eaf8fbfafbdfa55c3ecb31ddbb3c2d2
BLAKE2b-256 9ba93c5b09b3bfc36156a7a3c1f0b0942ff45a03015910e48c3a0e738e8e14ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpvsim-3.0.0-py3-none-any.whl:

Publisher: pypi_release.yaml on starsimhub/hpvsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 files

2.3.0

2 files

2.2.7

2 files

2.2.6

2 files

2.2.4

2 files

2.2.1

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.1

2 files

1.0.0

2 files

0.4.16

2 files

0.4.5

2 files

0.4.0

2 files

0.3.7

2 files

0.3.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page