Skip to main content

manyfutures

Runs a household's retirement plan over many simulated futures: how often the plan runs short, the money left at the end, and which of its inputs matter most.

The engine was built for a private dashboard and moved here in 0.1.0: the plan and its assumptions, the simulated futures and the measures over them, with the projected life table of Statistics Netherlands (CBS) for how long each future lasts. Every amount is in today's euros. The household lives in Amsterdam, under Dutch tax, unless its plan moves it to one of the other places the engine knows.

Install

pip install manyfutures

or uv add manyfutures. Python 3.11 or later; the only dependencies are numpy and pydantic.

An example

A made-up household: two adults born in 1990 and 1992, earning 180,000 a year between them and spending 40,000, with one child, a home bought in 2024 with a 350,000 mortgage, and a student loan of £20,000. Its plan is the Scenario's defaults: retiring at 58 on 40,000 a year, 30,000 of it Must-have Spending, with 40,000 a year of Bridge Income until the pension at 67 and a downsize to a 350,000 home.

from datetime import date

import numpy as np
from manyfutures import Assumptions, Scenario, Start, readouts, run
from manyfutures.models import Adult, MortgageTerms, Position, StudentLoanTerms

household = Assumptions(  # its facts; every other Assumption is one of the engine's own model constants
    first_adult=Adult(born=date(1990, 1, 1), life_series="men"), partner=Adult(born=1992, life_series="women"),
    gross_income=180_000, working_years_spending=40_000, pension=20_000, child_birth_ages=(33,),
    daycare_days_per_week=2, daycare_monthly_per_day=500, childcare_reimbursement_rate=0.33, after_school_monthly=300,
    mortgage=MortgageTerms(rate=0.035, term=30, start=date(2024, 1, 1)),
    student_loan=StudentLoanTerms(rate=0.03, repayment=500, repayment_day=1),
)
position = Position(portfolio=350_000, crypto=0, cash_buffer=30_000, home_value=520_000, mortgage_balance=340_000,
                    student_loan=20_000)
returns = np.random.default_rng(1).normal(0.07, 0.17, 120)  # made up: one a year, 1906 to 2025
start = Start(today=date(2026, 6, 1), position=position, returns=returns, return_years=np.arange(1906, 2026))
metrics = run(Scenario(), start, assumptions=household).metrics
print("Chance of running short:", readouts.chance(metrics.chance_of_running_short, metrics.chance_of_running_short_se))

It prints:

Chance of running short: 21.7% ± 0.6

About one future in five runs short: in at least one of its years more than a tenth of the Must-have Spending goes unfunded. The ± is one standard error of the simulation, in points, over the 5,000 futures a Scenario runs by default.

The three inputs:

  • Assumptions: the household's facts, which have no default, and the model's constants, which do (inflation, investment costs, the life table, the Running Short threshold and the rest).
  • Start: where the plan begins, the household's money and debts on a date (a Position) and the market's past returns, each with its calendar year. Here the returns are made up; a real run is handed a history such as the S&P 500's. The engine fetches nothing.
  • Scenario: the household's decisions, each with a default, so a Scenario names only those that differ.

run gives an Outcome: its metrics (the chance of running short, how deep and for how long, the money left at the end, the same readouts over the futures that last to 95), the End Ages and the portfolio at each age. return_band runs the same plan with every year's return a point lower and a point higher, compare runs it in every place, and inputs_that_matter moves one hand-set input at a time.

The engine's words and decisions

  • GLOSSARY.md: the words, each defined once.
  • docs/decisions.md: the modelling decisions, numbered as they were made, each with its rule, its reason and the code and tests that hold it.
  • docs/adr/: the decisions that are not to be reopened, the End Age's among them.
  • CHANGELOG.md: what each release changed, and whether it moved the headline.

Licence

MIT: see LICENSE. The bundled life table is CBS's (CC BY 4.0) and the US inflation the BLS's, through FRED (public domain); each file's header says where it comes from.

Metadata

Release files for manyfutures 0.1.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 manyfutures 0.1.0
File Size Uploaded Provenance Actions
manyfutures-0.1.0.tar.gz 254.9 kB With provenance Details for manyfutures-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 375.7 kB

Release files / manyfutures-0.1.0.tar.gz

Download URL manyfutures-0.1.0.tar.gz
Size 254.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0dae62d11ffed483eb80f46960d9cee725c0daaf3c7e396c727dc5f5d96bbe9a
BLAKE2b-256 checksum
How to use checksums
17b4745611518d251d87a84498b2b4d699bea23fc5af4696d6a4c433ec15a81a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / manyfutures-0.1.0-py3-none-any.whl

Download URL manyfutures-0.1.0-py3-none-any.whl
Size 120.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecf6ff3be7b63366ebe47a4ce6ad65f56c020be3c2c7b4cca906a0fa932cff15
BLAKE2b-256 checksum
How to use checksums
86c192bb7911f5ba93b18d7a2ebad3b7e9367da02bf3bfe2410a3ac1ce479b3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for manyfutures 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for manyfutures-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

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