refi-calculator 0.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of refi-calculator might be problematic. Click here for more details.

Files changed (35) hide show
  1. refi_calculator/__init__.py +9 -0
  2. refi_calculator/cli.py +64 -0
  3. refi_calculator/core/__init__.py +36 -0
  4. refi_calculator/core/calculations.py +713 -0
  5. refi_calculator/core/charts.py +77 -0
  6. refi_calculator/core/market/__init__.py +11 -0
  7. refi_calculator/core/market/constants.py +24 -0
  8. refi_calculator/core/market/fred.py +62 -0
  9. refi_calculator/core/models.py +131 -0
  10. refi_calculator/environment.py +124 -0
  11. refi_calculator/gui/__init__.py +13 -0
  12. refi_calculator/gui/app.py +1008 -0
  13. refi_calculator/gui/builders/__init__.py +9 -0
  14. refi_calculator/gui/builders/analysis_tab.py +92 -0
  15. refi_calculator/gui/builders/helpers.py +90 -0
  16. refi_calculator/gui/builders/info_tab.py +195 -0
  17. refi_calculator/gui/builders/main_tab.py +173 -0
  18. refi_calculator/gui/builders/market_tab.py +115 -0
  19. refi_calculator/gui/builders/options_tab.py +81 -0
  20. refi_calculator/gui/builders/visuals_tab.py +128 -0
  21. refi_calculator/gui/chart.py +459 -0
  22. refi_calculator/gui/market_chart.py +192 -0
  23. refi_calculator/web/__init__.py +11 -0
  24. refi_calculator/web/app.py +117 -0
  25. refi_calculator/web/calculator.py +317 -0
  26. refi_calculator/web/formatting.py +90 -0
  27. refi_calculator/web/info.py +226 -0
  28. refi_calculator/web/market.py +270 -0
  29. refi_calculator/web/results.py +455 -0
  30. refi_calculator/web/runner.py +22 -0
  31. refi_calculator-0.8.0.dist-info/METADATA +146 -0
  32. refi_calculator-0.8.0.dist-info/RECORD +35 -0
  33. refi_calculator-0.8.0.dist-info/WHEEL +4 -0
  34. refi_calculator-0.8.0.dist-info/entry_points.txt +4 -0
  35. refi_calculator-0.8.0.dist-info/licenses/LICENSE.txt +201 -0
@@ -0,0 +1,9 @@
1
+ """Refinance calculator package exports."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __all__ = []
6
+
7
+ __description__ = """
8
+ Root package for the refinance calculator application.
9
+ """
refi_calculator/cli.py ADDED
@@ -0,0 +1,64 @@
1
+ """Command-line launcher for the refinance calculator app."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import os
7
+ from importlib.metadata import PackageNotFoundError, version
8
+ from logging import basicConfig, getLogger
9
+
10
+ from refi_calculator.environment import load_dotenv
11
+ from refi_calculator.gui.app import main as launch_gui
12
+
13
+ logger = getLogger(__name__)
14
+
15
+
16
+ def _get_distribution_version() -> str | None:
17
+ if env_version := os.environ.get("REFI_VERSION"):
18
+ return env_version
19
+ try:
20
+ return version("refi-calculator")
21
+ except PackageNotFoundError:
22
+ logger.debug("Unable to determine installed version.")
23
+ return None
24
+
25
+
26
+ def _create_parser() -> argparse.ArgumentParser:
27
+ """Build the CLI argument parser.
28
+
29
+ Returns:
30
+ A configured parser for handling CLI options.
31
+ """
32
+ parser = argparse.ArgumentParser(
33
+ prog="refi-calculator",
34
+ description="Launch the refinance calculator UI.",
35
+ )
36
+ parser.add_argument(
37
+ "--version",
38
+ "-V",
39
+ action="version",
40
+ version=_get_distribution_version() or "refi-calculator (development build)",
41
+ help="Show version information and exit.",
42
+ )
43
+ return parser
44
+
45
+
46
+ def main(argv: list[str] | None = None) -> None:
47
+ """Launch the refinance calculator UI.
48
+
49
+ Args:
50
+ argv: Optional argument list; defaults to ``sys.argv`` when ``None``.
51
+ """
52
+ parser = _create_parser()
53
+ parser.parse_args(argv)
54
+ load_dotenv()
55
+ basicConfig(level="INFO")
56
+ logger.info("Launching Refi-Calculator UI")
57
+ launch_gui()
58
+
59
+
60
+ __all__ = ["main"]
61
+
62
+ __description__ = """
63
+ Command-line launcher for the refinance calculator UI.
64
+ """
@@ -0,0 +1,36 @@
1
+ """Shared core library for the refinance calculator package."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .calculations import (
6
+ analyze_refinance,
7
+ calculate_accelerated_payoff,
8
+ calculate_total_cost_npv,
9
+ generate_amortization_schedule,
10
+ generate_amortization_schedule_pair,
11
+ generate_comparison_schedule,
12
+ run_holding_period_analysis,
13
+ run_sensitivity,
14
+ )
15
+ from .charts import MIN_LINEAR_TICKS, build_linear_ticks, build_month_ticks
16
+ from .models import LoanParams, RefinanceAnalysis
17
+
18
+ __all__: list[str] = [
19
+ "analyze_refinance",
20
+ "calculate_accelerated_payoff",
21
+ "calculate_total_cost_npv",
22
+ "generate_amortization_schedule",
23
+ "generate_amortization_schedule_pair",
24
+ "generate_comparison_schedule",
25
+ "run_holding_period_analysis",
26
+ "run_sensitivity",
27
+ "LoanParams",
28
+ "RefinanceAnalysis",
29
+ "MIN_LINEAR_TICKS",
30
+ "build_month_ticks",
31
+ "build_linear_ticks",
32
+ ]
33
+
34
+ __description__ = """
35
+ Common calculations, models, and chart helpers that can be shared across interfaces.
36
+ """