Skip to main content

Refi Calculator Package.

Project description

Refi-Calculator

CI PyPI Python License Ruff Pre-commit Docs codecov

Refi-Calculator helps borrowers analyze whether refinancing makes sense by comparing current and proposed loan terms through breakeven, NPV, amortization, and holding-period views inside a Tkinter GUI.

Features

  • Side-by-side analysis of current vs. proposed mortgage payments (nominal and after-tax)
  • Breakeven and holding-period tables with clear recommendations
  • Accelerated payoff planning for maintaining current payment levels
  • Loan Visualizations tab with the amortization comparison table (including cumulative interest Δ) plus the refreshed cumulative savings chart (ticks, zero-line label) and a new balance comparison chart for current vs. new loans
  • Exportable CSV data for every tab
  • Live market tab (when FRED_API_KEY is configured) surfaces historical 30-year fixed rates and pre-fills the refinance rate so you start with a realistic benchmark.
  • Interactive history chart in the Market tab plus the value table below it with 30Y/15Y toggles for quick comparisons.

Getting Started

Requirements

  • Python 3.13+
  • Poetry for dependency management (the virtual environment lives in .venv/)

Installation

poetry install

This command creates the virtual environment, installs dependencies, and prepares the hooks defined in .pre-commit-config.yaml.

If you only need the GUI experience, install with pip install .[gui]; to enable the Streamlit placeholder or eventual web UI, install pip install .[web].

For a global CLI install, use pipx once the package is published, or run a local install with:

pipx install refi-calculator
# or (for development)
pip install -e .

Running the GUI

poetry run refi-calculator

The refi-calculator console script now launches the Tkinter application exposed via refi_calculator.gui.app:main, so you can start the GUI with poetry run refi-calculator or via pipx once the package is installed globally.

Running the Web placeholder

After installing the web optional dependencies (pip install .[web]), run poetry run refi-calculator-web to launch the Streamlit placeholder. That console script now invokes the Streamlit CLI (streamlit run .../src/refi_calculator/web/app.py) so you get the normal script context and browser experience while the full Streamlit workflow is still under construction.

Testing & Quality

  • poetry run pre-commit run --all-files (runs formatting, linting, safety hooks, etc.)
  • poetry run pytest (not yet populated, but ready for future tests)

Market Data Tab

  • Set the FRED_API_KEY environment variable to pull historical 30-year fixed-rate data when you launch the app. The Market tab will populate a refreshable table and update the default refinance rate using the latest observation. If the key is missing or the FRED request fails, the tab keeps working but reports the reason for the skip.
  • Use the selectors inside the Market section to start with one year of history or extend the view to two years, five years, or all available data. The chart overlays both tenors with a legend, and the table below shows one column per tenor for the selected time window.

Add new tests under tests/ following the test_*.py pattern whenever you enhance functionality.

Hosted Streamlit Preview

Documentation

Code Structure

  • src/refi_calculator/core/: Shared calculations, models, and utility helpers used by every interface.
  • src/refi_calculator/gui/: Tkinter GUI composed of:
    • app.py: The main application wiring.
    • chart.py: Custom savings chart canvas relying on shared helpers.
    • builders/: Tab-specific builders and UI helpers.
  • src/refi_calculator/web/: Streamlit placeholder (future web UI) exposing main().
  • src/refi_calculator/cli.py: CLI launcher exposed via the refi-calculator console script.
  • bin/refi-calculator.py: Entry point that runs the GUI.

Contributing

  • Keep imports grouped by functionality (allow isort to do the heavy lifting through pre-commit).
  • Update or add tests in tests/ before opening a pull request.
  • Run poetry run pre-commit run --all-files to catch formatting/lint issues early.

License

See LICENSE.txt for licensing details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refi_calculator-0.9.1.tar.gz (51.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refi_calculator-0.9.1-py3-none-any.whl (62.6 kB view details)

Uploaded Python 3

File details

Details for the file refi_calculator-0.9.1.tar.gz.

File metadata

  • Download URL: refi_calculator-0.9.1.tar.gz
  • Upload date:
  • Size: 51.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for refi_calculator-0.9.1.tar.gz
Algorithm Hash digest
SHA256 30cc1e33d53b02c782bff8cd33c0f436ed02888739e4734fb591999cfc4cdbd6
MD5 f87037f734066030223f2cb6815f1c1a
BLAKE2b-256 3931a0471cd8cb41225eb5eb3f53dd14103255c705e39af90ba5b83b83392c37

See more details on using hashes here.

File details

Details for the file refi_calculator-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: refi_calculator-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 62.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for refi_calculator-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d39599cbe0ba04fa165614a2dde7cd4b41a063f75f32b9cac7a28d3dedbaec4
MD5 602423a23f4d1d4af150778b9b761a47
BLAKE2b-256 65744c2cf084152222434189cf23efd467ec66d154b1d11f7df3f88316a000ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page