A Streamlit app for exploring mortgage affordability, rental room pricing, early repayment, and investment tradeoffs for a rented property.
The app models a property purchase with a mortgage and rented rooms. It lets you tune the main financial assumptions directly on the page, then shows how much monthly cashflow remains after rent, taxes, mortgage payments, and operating costs.
That expendable cashflow can be split between:
The repayment/investment split always totals 100%.
pip install -r requirements.txt
streamlit run main.py
make test
Shows the key numbers for the current scenario:
Contains the core purchase assumptions:
Notary and agency costs can be entered either as fixed euro amounts or as percentages of the house price.
The nearby pie chart shows how upfront cash is split across down payment and initial costs.
Compares mortgage interest with the rent you would pay while saving enough cash to buy outright.
Inputs:
The section estimates time to buy cash, future cash purchase target, rent paid while waiting, total mortgage interest, buy-now savings during the waiting horizon, and a buy-now advantage score. It also shows a sensitivity heatmap around 0% house price growth and 0% savings return.
Models the rental side of the property:
The room table supports any number of rooms. Add or remove rows to change the room count. Empty room labels are automatically filled as Room 1, Room 2, and so on. The break-even chart shows monthly cashflow by number of rented rooms.
Uses only expendable monthly cashflow:
net rent - mortgage payment - monthly operating costs
That amount is split between extra mortgage principal and investment. The arrow buttons move the allocation:
The alternative annual return is editable next to the invested-surplus value. One-off repayment events can also be added in the table by entering the year and extra repayment amount.
Compares the base mortgage balance with the selected combined strategy. The strategy assumes:
Breaks the scenario into readable sections:
Use this section to audit the exact values behind the charts and headline metrics.
main.py Streamlit UI and orchestration
charts.py Plotly chart builders
documentation.py Streamlit formulas and references section
formatting.py Money display helpers
investment.py Repayment-vs-investment strategy and scenario helpers
models.py Shared dataclasses for typed calculation inputs and results
mortgage.py Mortgage payment, amortization, and repayment simulation helpers
rental.py Rental income helpers
scenarios.py Room scenario helpers
tests/ Calculation regression tests
components/ Local Streamlit components for custom cost inputs and allocation buttons