skillfed

policyengine-core

Core microsimulation engine enabling country-specific policy models.

policyengine-core v3.31.0 131.1K downloads/30d#11,610 on PyPI20
AGPL license Active released

What it is and what it does

PolicyEngine Core is a microsimulation engine forked from OpenFisca-Core that provides the foundational machinery for policy modeling. It includes a simulation engine, parameter tree, variable system, and reform framework that country-specific policy packages (such as policyengine-uk, policyengine-us, policyengine-canada, policyengine-il, policyengine-ng) build on top of. The package is designed to calculate tax and benefit outcomes across populations under different policy scenarios.

Most developers encounter this package transitively through a country model rather than installing it directly. Direct installation is appropriate when building a new country model, writing custom reforms, or extending the core simulation engine itself. The package depends on scientific Python libraries (numpy, pandas, numexpr, h5py) for numerical computation and data handling, plus visualization (plotly, pyvis) and utility libraries. It is actively maintained, supports modern Python versions (3.9–3.14), and carries no known security vulnerabilities.

Use it for:

  • Building a new country-specific policy model by extending the core simulation and variable framework.
  • Writing custom tax or benefit reforms to model policy changes and calculate fiscal impacts.
  • Running population-level microsimulations to evaluate policy outcomes under different scenarios.
  • Integrating policy modeling into downstream applications or APIs that need to compute tax and benefit calculations.
  • Extending or modifying the core engine when the standard country models do not cover your jurisdiction or use case.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PolicyEngine Core provides a microsimulation engine and policy reform framework that powers country-specific tax and benefit models, enabling users to run policy scenarios and calculate outcomes across populations.

Yes, if you are building a country policy model, writing custom reforms, or integrating policy simulation into an application. No, if you simply need to run policy scenarios—install a country model instead (policyengine-uk, policyengine-us, etc.), which brings this as a dependency. The AGPL license requires derivative works to be open-source, which is appropriate for public-interest policy tools but may conflict with proprietary use.

Install

policyengine-core on PyPI

pip

pip install policyengine-core

uv

uv add policyengine-core

poetry

poetry add policyengine-core

Installing policyengine-core

Before you install

Low friction installation with a pure Python wheel. Actively maintained with a release on 2026-08-14 and no known vulnerabilities. Supports Python 3.9 through 3.14, covering current and recent Python versions.

License in practice

Distributed under AGPL v3, which requires that any modifications or derivative works be shared under the same license. This is a copyleft obligation suitable for open-source policy tools but may constrain proprietary use.

Quickstart

pip install policyengine-core

from policyengine_core.simulations import Simulation
from policyengine_core.reforms import Reform

# Use Simulation and Reform classes to model policy scenarios

Requires Python 3.9 or later. Most users should install via a country model (policyengine-uk, policyengine-us, etc.) rather than directly.

Verify before relying

  • Whether the package's 16 runtime dependencies (including h5py, plotly, pyvis) are all necessary for typical use cases or if many are optional.
  • Performance characteristics and scalability limits for large population simulations.
  • Compatibility guarantees between policyengine-core versions and downstream country model packages.

Package facts

License not declared (agpl)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 16 — dpath, h5py, huggingface-hub, ipython, microdf-python, numexpr, numpy, pandas, plotly, psutil, pytest, pyvis, requests, sortedcontainers, standard-imghdr, wheel
Maintenance actively maintained — 0 days since the last release
Last repo commit
First released
Downloads 131,083/month — #11,610 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: policyengine_core-3.31.0-py3-none-any.whl

Development Status :: 5 - Production/StableLicense :: OSI Approved :: GNU Affero General Public License v3Operating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Information Analysis

Tags

tax benefit microsimulationpolicy reform enginefiscal impact modelingcountry policy modelstax calculator frameworkwelfare policy simulationpolicy scenario analysis
policy-modelingmicrosimulationtax-benefit

More Information Analysis packages