Skip to main content

FPsim: Family Planning Simulator

FPsim is the Institute for Disease Modeling's agent-based model of family planning. It simulates women's contraceptive and reproductive histories over the life course, so that program and policy questions -- what happens if a new method is introduced, or if access changes for younger women -- can be explored before committing resources. It is calibrated to nine settings across sub-Saharan Africa and South Asia.

FPsim is currently under development.

Quick start

Install with pip install fpsim, then:

import fpsim as fp

sim = fp.Sim(location='kenya', n_agents=1000, start_year=2000, end_year=2020)
sim.run()
sim.plot()

See the tutorials to go further.

When to use FPsim

FPsim is designed as an open-source tool for family planning research. However, it is not a silver bullet tool. It is designed to answer complex questions about emerging dynamics in complex social and behavioral systems. Its strength stems from a life-course approach, which allows researchers to examine how compounding and temporal effects unfold over women's lives, and how these individual-level changes lead to macro-level outcomes.

Before using FPsim, please refer to the following guidelines:

  • FPsim is only as good as the data and assumptions provided. Be sure you are familiar with both before using FPsim.
  • FPsim is not a replacement for good data. The model cannot tell you what demand for a hypothetical method will be.
  • FPsim is not a replacement for descriptive statistics. Before using FPsim, assess your primary research question(s). Can they be answered using descriptive statistics?
  • FPsim cannot predict exogenous events. Use caution when interpreting and presenting results. For example, FPsim cannot predict regional conflicts or pandemics, nor their impacts on FP services.

Repo structure

The structure is as follows:

  • FPsim, in the folder fpsim, is a standalone Python library for performing family planning analyses.
  • Within fpsim, the locations folder contains parameters and input data for all countries currently calibrated.
  • Docs are in the docs folder.
  • Examples are in the examples folder.
  • Tests are in the tests folder.

Installation

Run pip install fpsim to install and its dependencies from PyPI. Alternatively, clone the repository and run pip install -e . (including the final dot!). To be able to run tests and build the docs as well, use pip install -e .[dev].

Documentation

Documentation is available at https://docs.fpsim.org.

Disclaimer

The code in this repository was developed by IDM and other collaborators to support our joint research on family planning. 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 FPsim 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. See the contributing and code of conduct READMEs for more information.

Metadata

Release files for fpsim 3.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fpsim 3.6.0
File Size Uploaded Provenance Actions
fpsim-3.6.0.tar.gz 1.6 MB Without provenance Details for fpsim-3.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fpsim 3.6.0
File Interpreter ABI Platform Actions
fpsim-3.6.0-py3-none-any.whl Python 3 none any Details for fpsim-3.6.0-py3-none-any.whl

Total release size: 2.6 MB

Release files / fpsim-3.6.0.tar.gz

Download URL fpsim-3.6.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
1bdc85efd59052f39741d23a86c3ea3d53edd2acd3b4fde9992ba6d838866ac8
BLAKE2b-256 checksum
How to use checksums
2f8877ccddb79b84976ef96da2bc75b6f2a53e08d3641e6f0360fc86b9fdd9ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / fpsim-3.6.0-py3-none-any.whl

Download URL fpsim-3.6.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
eb93d05f3f40081dcf9197ccfa36cc1e93f7f255fc6e5065b0b9772a937d17e9
BLAKE2b-256 checksum
How to use checksums
a8049570e51ca3aea6c9401702aeee739ad55ecba991320ec153b1bae5de4b17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for fpsim 3.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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