loan-simu 0.2.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Léo Guignard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: loan-simu
3
+ Version: 0.2.0
4
+ Summary: Desktop simulator for French renovation loans (prêt travaux, éco-PTZ, TAEG, taux d'usure, taux d'endettement)
5
+ Author: Léo Guignard
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/leoguignard/loan-simu
8
+ Project-URL: Source, https://github.com/leoguignard/loan-simu
9
+ Project-URL: Issues, https://github.com/leoguignard/loan-simu/issues
10
+ Keywords: loan,mortgage,simulator,france,pret travaux,eco-ptz,taeg,amortization
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: X11 Applications :: Qt
13
+ Classifier: Intended Audience :: End Users/Desktop
14
+ Classifier: Natural Language :: English
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Office/Business :: Financial
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: PySide6>=6.5
28
+ Requires-Dist: matplotlib>=3.7
29
+ Provides-Extra: dev
30
+ Requires-Dist: bumpver; extra == "dev"
31
+ Requires-Dist: build; extra == "dev"
32
+ Requires-Dist: twine; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # Renovation Loan Simulator (France)
36
+
37
+ A desktop app (Qt / PySide6) to simulate a loan for renovating an apartment in France (*prêt travaux*).
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install loan-simu
43
+ loan-simu # or: python -m loan_simu
44
+ ```
45
+
46
+ It needs Python 3.10 or later. PySide6 and matplotlib are installed with it.
47
+
48
+ Numbers are shown in French format and you can type `4,5` or `4.5`. Results update as you type.
49
+
50
+ The app follows the system's light or dark mode. To force one, set `LOAN_SIMU_THEME=light` or `LOAN_SIMU_THEME=dark`.
51
+
52
+ ## Simple mode
53
+
54
+ You enter the works cost, down payment, duration, rate, insurance, your net monthly income and your other loan payments. You get:
55
+
56
+ - the monthly payment, the total cost of credit and the APR (TAEG)
57
+ - the debt ratio (*taux d'endettement*), on a gauge against the 35 % HCSF limit, and the money left each month
58
+ - a breakdown of capital, interest and insurance
59
+ - a table comparing durations from 3 to 25 years, with the debt ratio for each; click a row to use that duration
60
+
61
+ ## In-depth mode
62
+
63
+ | Area | What it covers |
64
+ |---|---|
65
+ | Project | Works cost, down payment (*apport*), grants (MaPrimeRénov', CEE…) |
66
+ | Main loan | Personal loan (*crédit conso*) or real-estate loan (*prêt immobilier*), rate, duration, partial or total deferral (*différé*) |
67
+ | Insurance | Rate, based on initial or remaining capital, coverage (*quotité*) |
68
+ | Fees | Bank fee (*frais de dossier*), guarantee (*caution* / *hypothèque*), broker fee |
69
+ | Éco-PTZ | 0 % loan for energy renovation, with a cap and maximum duration per category |
70
+ | Budget | Debt ratio against the 35 % HCSF limit, money left to live on (*reste à vivre*) |
71
+ | Early repayment | Penalty (IRA), interest saved, choice between a shorter loan and a lower payment |
72
+ | Checks | APR above the usury rate, consumer loan over 75 000 €, real-estate loan over 25 years |
73
+
74
+ The in-depth mode also has an amortization table (combined or per loan, by month or by year, exported as CSV for French Excel) and charts.
75
+
76
+ ## Calculation rules
77
+
78
+ - Monthly rate = nominal rate / 12 (*taux proportionnel*), constant monthly payments.
79
+ - The TAEG is the actuarial rate including interest, insurance and upfront fees. It is calculated without the early repayment, as banks do.
80
+ - IRA:
81
+ - real-estate loan: the lower of 6 months of interest and 3 % of the remaining capital
82
+ - consumer loan: 1 % of the amount repaid (0.5 % if 12 months or less remain), nothing for 10 000 € or less, capped at the remaining interest
83
+ - éco-PTZ: no penalty
84
+
85
+ ## Keep these up to date
86
+
87
+ The values in [src/loan_simu/core.py](https://github.com/leoguignard/loan-simu/blob/main/src/loan_simu/core.py) change over time:
88
+
89
+ - **Usury rates** (`USURY_*`) are published every quarter by the Banque de France. The real-estate table is from Q4 2026. The consumer table is from Q3 2026, because the Q4 figures were not found.
90
+ - **Éco-PTZ caps** (`ECO_PTZ_CATEGORIES`): check them on service-public.fr (page F19905).
91
+
92
+ ## Development
93
+
94
+ ```bash
95
+ git clone https://github.com/leoguignard/loan-simu.git
96
+ cd loan-simu
97
+ pip install -e ".[dev]" # app + release tools (bumpver, build, twine)
98
+ python -m unittest # engine tests + offscreen UI smoke test
99
+ ```
100
+
101
+ ```text
102
+ src/loan_simu/
103
+ core.py calculation engine (no GUI dependency)
104
+ ui/
105
+ app.py main window and entry point
106
+ simple.py simple mode
107
+ advanced.py in-depth mode
108
+ widgets.py cards, number fields, debt-ratio gauge
109
+ charts.py matplotlib charts
110
+ theme.py light/dark palettes and stylesheet
111
+ tests/ engine tests and an offscreen UI smoke test
112
+ ```
113
+
114
+ ### Releasing to PyPI
115
+
116
+ 1. Bump the version with [bumpver](https://github.com/mbarkhau/bumpver). It updates `pyproject.toml` and
117
+ `src/loan_simu/__init__.py`, then commits and tags (needs a clean working tree):
118
+
119
+ ```bash
120
+ bumpver update --patch --dry # preview the change
121
+ bumpver update --patch # or --minor / --major
122
+ git push --follow-tags
123
+ ```
124
+
125
+ 2. Build and check:
126
+
127
+ ```bash
128
+ rm -rf dist && python -m build
129
+ twine check dist/*
130
+ ```
131
+
132
+ 3. Upload to TestPyPI first, then to PyPI:
133
+
134
+ ```bash
135
+ twine upload --repository testpypi dist/*
136
+ twine upload dist/*
137
+ ```
138
+
139
+ ## Disclaimer
140
+
141
+ This is a simulation, not a loan offer. Your bank's offer (*offre de prêt*) and its FISE are the documents that count.
142
+
143
+ ## License
144
+
145
+ MIT, see [LICENSE](https://github.com/leoguignard/loan-simu/blob/main/LICENSE).
@@ -0,0 +1,111 @@
1
+ # Renovation Loan Simulator (France)
2
+
3
+ A desktop app (Qt / PySide6) to simulate a loan for renovating an apartment in France (*prêt travaux*).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install loan-simu
9
+ loan-simu # or: python -m loan_simu
10
+ ```
11
+
12
+ It needs Python 3.10 or later. PySide6 and matplotlib are installed with it.
13
+
14
+ Numbers are shown in French format and you can type `4,5` or `4.5`. Results update as you type.
15
+
16
+ The app follows the system's light or dark mode. To force one, set `LOAN_SIMU_THEME=light` or `LOAN_SIMU_THEME=dark`.
17
+
18
+ ## Simple mode
19
+
20
+ You enter the works cost, down payment, duration, rate, insurance, your net monthly income and your other loan payments. You get:
21
+
22
+ - the monthly payment, the total cost of credit and the APR (TAEG)
23
+ - the debt ratio (*taux d'endettement*), on a gauge against the 35 % HCSF limit, and the money left each month
24
+ - a breakdown of capital, interest and insurance
25
+ - a table comparing durations from 3 to 25 years, with the debt ratio for each; click a row to use that duration
26
+
27
+ ## In-depth mode
28
+
29
+ | Area | What it covers |
30
+ |---|---|
31
+ | Project | Works cost, down payment (*apport*), grants (MaPrimeRénov', CEE…) |
32
+ | Main loan | Personal loan (*crédit conso*) or real-estate loan (*prêt immobilier*), rate, duration, partial or total deferral (*différé*) |
33
+ | Insurance | Rate, based on initial or remaining capital, coverage (*quotité*) |
34
+ | Fees | Bank fee (*frais de dossier*), guarantee (*caution* / *hypothèque*), broker fee |
35
+ | Éco-PTZ | 0 % loan for energy renovation, with a cap and maximum duration per category |
36
+ | Budget | Debt ratio against the 35 % HCSF limit, money left to live on (*reste à vivre*) |
37
+ | Early repayment | Penalty (IRA), interest saved, choice between a shorter loan and a lower payment |
38
+ | Checks | APR above the usury rate, consumer loan over 75 000 €, real-estate loan over 25 years |
39
+
40
+ The in-depth mode also has an amortization table (combined or per loan, by month or by year, exported as CSV for French Excel) and charts.
41
+
42
+ ## Calculation rules
43
+
44
+ - Monthly rate = nominal rate / 12 (*taux proportionnel*), constant monthly payments.
45
+ - The TAEG is the actuarial rate including interest, insurance and upfront fees. It is calculated without the early repayment, as banks do.
46
+ - IRA:
47
+ - real-estate loan: the lower of 6 months of interest and 3 % of the remaining capital
48
+ - consumer loan: 1 % of the amount repaid (0.5 % if 12 months or less remain), nothing for 10 000 € or less, capped at the remaining interest
49
+ - éco-PTZ: no penalty
50
+
51
+ ## Keep these up to date
52
+
53
+ The values in [src/loan_simu/core.py](https://github.com/leoguignard/loan-simu/blob/main/src/loan_simu/core.py) change over time:
54
+
55
+ - **Usury rates** (`USURY_*`) are published every quarter by the Banque de France. The real-estate table is from Q4 2026. The consumer table is from Q3 2026, because the Q4 figures were not found.
56
+ - **Éco-PTZ caps** (`ECO_PTZ_CATEGORIES`): check them on service-public.fr (page F19905).
57
+
58
+ ## Development
59
+
60
+ ```bash
61
+ git clone https://github.com/leoguignard/loan-simu.git
62
+ cd loan-simu
63
+ pip install -e ".[dev]" # app + release tools (bumpver, build, twine)
64
+ python -m unittest # engine tests + offscreen UI smoke test
65
+ ```
66
+
67
+ ```text
68
+ src/loan_simu/
69
+ core.py calculation engine (no GUI dependency)
70
+ ui/
71
+ app.py main window and entry point
72
+ simple.py simple mode
73
+ advanced.py in-depth mode
74
+ widgets.py cards, number fields, debt-ratio gauge
75
+ charts.py matplotlib charts
76
+ theme.py light/dark palettes and stylesheet
77
+ tests/ engine tests and an offscreen UI smoke test
78
+ ```
79
+
80
+ ### Releasing to PyPI
81
+
82
+ 1. Bump the version with [bumpver](https://github.com/mbarkhau/bumpver). It updates `pyproject.toml` and
83
+ `src/loan_simu/__init__.py`, then commits and tags (needs a clean working tree):
84
+
85
+ ```bash
86
+ bumpver update --patch --dry # preview the change
87
+ bumpver update --patch # or --minor / --major
88
+ git push --follow-tags
89
+ ```
90
+
91
+ 2. Build and check:
92
+
93
+ ```bash
94
+ rm -rf dist && python -m build
95
+ twine check dist/*
96
+ ```
97
+
98
+ 3. Upload to TestPyPI first, then to PyPI:
99
+
100
+ ```bash
101
+ twine upload --repository testpypi dist/*
102
+ twine upload dist/*
103
+ ```
104
+
105
+ ## Disclaimer
106
+
107
+ This is a simulation, not a loan offer. Your bank's offer (*offre de prêt*) and its FISE are the documents that count.
108
+
109
+ ## License
110
+
111
+ MIT, see [LICENSE](https://github.com/leoguignard/loan-simu/blob/main/LICENSE).
@@ -0,0 +1,63 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "loan-simu"
7
+ dynamic = ["version"]
8
+ description = "Desktop simulator for French renovation loans (prêt travaux, éco-PTZ, TAEG, taux d'usure, taux d'endettement)"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.10"
13
+ authors = [{ name = "Léo Guignard" }]
14
+ keywords = ["loan", "mortgage", "simulator", "france", "pret travaux", "eco-ptz", "taeg", "amortization"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: X11 Applications :: Qt",
18
+ "Intended Audience :: End Users/Desktop",
19
+ "Natural Language :: English",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3 :: Only",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Programming Language :: Python :: 3.14",
28
+ "Topic :: Office/Business :: Financial",
29
+ ]
30
+ dependencies = ["PySide6>=6.5", "matplotlib>=3.7"]
31
+
32
+ [project.optional-dependencies]
33
+ dev = ["bumpver", "build", "twine"]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/leoguignard/loan-simu"
37
+ Source = "https://github.com/leoguignard/loan-simu"
38
+ Issues = "https://github.com/leoguignard/loan-simu/issues"
39
+
40
+ [project.gui-scripts]
41
+ loan-simu = "loan_simu.ui.app:main"
42
+
43
+ [tool.setuptools.dynamic]
44
+ version = { attr = "loan_simu.__version__" }
45
+
46
+ [tool.setuptools.packages.find]
47
+ where = ["src"]
48
+
49
+ [tool.pytest.ini_options]
50
+ testpaths = ["tests"]
51
+ pythonpath = ["src"]
52
+
53
+ [tool.bumpver]
54
+ current_version = "0.2.0"
55
+ version_pattern = "MAJOR.MINOR.PATCH"
56
+ commit_message = "Bump version {old_version} -> {new_version}"
57
+ commit = true
58
+ tag = true
59
+ push = false
60
+
61
+ [tool.bumpver.file_patterns]
62
+ "pyproject.toml" = ['current_version = "{version}"']
63
+ "src/loan_simu/__init__.py" = ['__version__ = "{version}"']
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Renovation loan simulator for France."""
2
+
3
+ __version__ = "0.2.0"
@@ -0,0 +1,3 @@
1
+ from .ui.app import main
2
+
3
+ main()