A fork of OpenFisca-Core that powers PolicyEngine country models (policyengine-uk, policyengine-us, policyengine-canada, policyengine-il, policyengine-ng) and the downstream apps and APIs. Provides the simulation engine, parameter tree, variable system, and reform machinery that each country package builds on top of.
pip install policyengine-core
Supports Python 3.9 – 3.14.
Most users reach this package transitively through a country model. Import directly if you're building a new country model, writing a reform, or extending the core:
from policyengine_core.simulations import Simulation from policyengine_core.reforms import Reform
See the documentation for API reference and tutorials.
# Install dev dependencies (uses uv) make install # Run the full test suite make test # Run a single test uv run pytest tests/core/test_file.py::test_name -v # Format before committing (CI enforces) make format
Always use uv run for Python commands; bare python / pytest / pip may pick up the wrong environment.
Contributions: see CONTRIBUTING.md for branching, PR conventions, and the towncrier changelog.d/ workflow. Default branch is master.
Distributed under the AGPL License. See LICENSE for details.
- Forked from OpenFisca-Core.
- README template adapted from Othneil Drew's Best-README-Template.