Modeling BC property transfer tax and Canadian mortgage payments in Python
Most mortgage calculators you find online are quietly wrong for Canada, and most property tax snippets ignore the edge cases that matter. I needed both for a side project about British Columbia housing costs, so I wrote them from scratch in plain Python. Here's the code, the two gotchas that trip people up, and the output. The rules we're modelling BC property transfer tax (PTT) is charged on a…
The article discusses creating accurate Python code to model British Columbia property transfer tax (PTT) and Canadian mortgage payments. Property transfer tax rates depend on the home's fair market value, with specific brackets. First-time home buyers registered after April 1, 2024, receive exemptions and tax reductions. The code accounts for these rules and calculates the tax amount.
For mortgage payments, the article explains that Canadian fixed-rate mortgages compound semi-annually, not monthly. This differs from common online calculators that use monthly compounding. The article provides a formula to convert an annual interest rate to a Canadian monthly rate for fixed mortgages. Using the incorrect monthly rate can lead to overestimating mortgage payments, potentially costing borrowers thousands of dollars over the life of the loan.
The code demonstrates how to calculate mortgage payments using the correct semi-annual compounding rate.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.