{"id":49355184,"url":"https://github.com/maximefarre/portfolio-tracker","last_synced_at":"2026-04-27T13:02:38.834Z","repository":{"id":334736024,"uuid":"1122225152","full_name":"MaximeFARRE/portfolio-tracker","owner":"MaximeFARRE","description":"PyQt6 desktop app for personal and family wealth tracking portfolio, credits, projections, and cash flow. Local SQLite, optional Turso sync.","archived":false,"fork":false,"pushed_at":"2026-04-22T20:12:00.000Z","size":1169,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-22T22:16:31.931Z","etag":null,"topics":["backtesting","monte-carlo-simulation","portfolio-tracker","projections","pyqt6","python","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaximeFARRE.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-24T10:06:34.000Z","updated_at":"2026-04-22T20:12:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MaximeFARRE/portfolio-tracker","commit_stats":null,"previous_names":["maximefarre/suivie-patrimoine","maximefarre/portfolio-tracker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MaximeFARRE/portfolio-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Fportfolio-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Fportfolio-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Fportfolio-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Fportfolio-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaximeFARRE","download_url":"https://codeload.github.com/MaximeFARRE/portfolio-tracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaximeFARRE%2Fportfolio-tracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32337274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backtesting","monte-carlo-simulation","portfolio-tracker","projections","pyqt6","python","sqlite"],"created_at":"2026-04-27T13:02:37.995Z","updated_at":"2026-04-27T13:02:38.814Z","avatar_url":"https://github.com/MaximeFARRE.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Header --\u003e\n\u003cdiv align=\"center\"\u003e\n\n# Patrimoine Desktop\n\n**A PyQt6 desktop application for personal and family wealth tracking.**\n\n[![Python](https://img.shields.io/badge/Python-3.11%2B-3776ab?style=flat-square\u0026logo=python\u0026logoColor=white)](https://www.python.org/)\n[![PyQt6](https://img.shields.io/badge/PyQt6-6.7%2B-41cd52?style=flat-square\u0026logo=qt\u0026logoColor=white)](https://www.riverbankcomputing.com/software/pyqt/)\n[![SQLite](https://img.shields.io/badge/Database-SQLite-003b57?style=flat-square\u0026logo=sqlite\u0026logoColor=white)](https://www.sqlite.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-f0db4f?style=flat-square)](LICENSE)\n[![Tests](https://img.shields.io/badge/tests-235%20collected-brightgreen?style=flat-square)](tests/)\n[![Code style](https://img.shields.io/badge/code%20style-Black-000000?style=flat-square)](https://black.readthedocs.io/)\n[![Lint](https://img.shields.io/badge/lint-Ruff-d7ff64?style=flat-square)](https://docs.astral.sh/ruff/)\n[![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey?style=flat-square)](#installation)\n\n\u003c/div\u003e\n\n---\n\n## About\n\nPatrimoine Desktop consolidates all your financial accounts — bank, brokerage, savings, credit, real estate, private equity, and business holdings — into a single local desktop application. It tracks portfolio performance, models credit amortization, imports bank transactions, manages import rollbacks, and simulates future wealth trajectories using deterministic, Monte Carlo, and stress-test projection engines.\n\nAll data is stored locally in a SQLite database. An optional remote replica via [Turso/libsql](https://turso.tech/) is supported for multi-device sync.\n\n---\n\n## Features\n\n| Domain | Capabilities |\n|---|---|\n| **Family dashboard** | Consolidated net worth, allocations, cash flow, savings rate, weekly trends |\n| **Portfolio tracking** | Live prices via yfinance, weekly history, FX-adjusted positions, performance, Sharpe / VaR / ES / beta analytics |\n| **Efficient frontier \u0026 backtesting** | Portfolio optimization, benchmark comparison, improved allocation simulation |\n| **Credit management** | Amortization schedules, deferred loans, real cost KPIs, remaining capital tracking |\n| **Data import** | CSV (expenses, revenues, Bankin), Trade Republic via `pytr`, ticker preview, alias mapping, import history and rollback |\n| **Transaction management** | Edit/delete transaction flows with cashflow resynchronization |\n| **Projections** | Goal-based projections, native milestones, Monte Carlo simulation, stress scenarios, FIRE targets |\n| **Sankey \u0026 cash flow** | Visual cash flow breakdown, passive income, family-level flux summaries |\n| **PDF export** | Printable wealth summary report |\n| **Multi-currency** | FX-adjusted positions, weekly historical FX rates, missing-rate data-quality handling |\n\n---\n\n## Tech stack\n\n| Layer | Technology |\n|---|---|\n| UI | [PyQt6](https://www.riverbankcomputing.com/software/pyqt/), [Plotly](https://plotly.com/python/) (charts via WebEngine), Matplotlib |\n| Data | [pandas](https://pandas.pydata.org/), [NumPy](https://numpy.org/), [SciPy](https://scipy.org/) |\n| Market data | [yfinance](https://github.com/ranaroussi/yfinance), OpenFIGI (ISIN resolution), Frankfurter API (FX) |\n| Database | SQLite (local) · [libsql/Turso](https://turso.tech/) (optional remote replica) |\n| Import | [pytr](https://github.com/pytr-org/pytr) (Trade Republic), CSV pipelines |\n| Export | [fpdf2](https://py-pdf.github.io/fpdf2/) |\n| Tests \u0026 quality | [pytest](https://docs.pytest.org/), [Ruff](https://docs.astral.sh/ruff/), [Black](https://black.readthedocs.io/), pre-commit |\n\n---\n\n## Installation\n\n**Requirements:** Python 3.11+\n\n```bash\n# 1. Clone the repository\ngit clone https://github.com/MaximeFARRE/portfolio-tracker.git\ncd portfolio-tracker\n\n# 2. Create a virtual environment\npython -m venv .venv\n\n# Windows\n.\\.venv\\Scripts\\Activate.ps1\n# macOS / Linux\nsource .venv/bin/activate\n\n# 3. Install dependencies\npip install -r requirements.txt\n```\n\n### Development setup\n\n```bash\npip install -r requirements-dev.txt\npre-commit install --hook-type pre-commit --hook-type pre-push\n```\n\nThe local hooks run Ruff and Black automatically before commits and pushes.\n\n### Optional features\n\n**Trade Republic import** (requires a TR account and 2FA setup):\n```bash\npip install pytr curl_cffi websockets\n```\n\n**Turso remote database** (optional — SQLite works out of the box):\n```bash\npip install libsql libsql-client\n```\nThen copy `.env.example` to `.env` and set your credentials.\n\n---\n\n## Usage\n\n```bash\npython main.py\n```\n\nThe app opens with a family dashboard. Use the left sidebar to navigate between views.\n\n**Data storage:**\n- Default: local SQLite database (`~/.patrimoine/patrimoine.db`)\n- Logs: `~/.patrimoine/logs/`\n- Automatic DB backups on exit: `~/.patrimoine/backups/`\n\n**Remote database (Turso):**  \nSet `TURSO_DATABASE_URL` and `TURSO_AUTH_TOKEN` in your `.env` file (see `.env.example`).\n\n---\n\n## Running tests\n\n```bash\npytest\n```\n\n235 collected tests covering snapshots, cash flow, passive income, credits, imports, rollbacks, projections, portfolios, FX, backtesting, and UI/service integration.\n\nCode quality checks:\n\n```bash\npython -m pre_commit run ruff --all-files\npython -m pre_commit run black --all-files\n```\n\n---\n\n## Project structure\n\n```text\npatrimoine-desktop/\n│\n├── main.py                     Entry point — logging, DB backup, Qt bootstrap\n├── core/\n│   └── db_connection.py        Thread-safe DB connection singleton\n│\n├── db/\n│   ├── schema.sql              SQLite schema\n│   └── migrations/             Versioned SQL migrations (001 → 005)\n│\n├── qt_ui/\n│   ├── main_window.py          Application shell and navigation\n│   ├── theme.py                Color palette and stylesheet constants\n│   ├── pages/                  Top-level pages (famille, personnes, import, projection, settings)\n│   ├── panels/                 Domain-specific panels (bourse, credit, PE, immobilier…)\n│   ├── widgets/                Reusable UI components (DataTable, KpiCard, PlotlyView…)\n│   └── components/             Animated containers and skeleton handlers\n│\n├── services/                   Business logic layer — all KPIs live here\n│   ├── bourse_analytics.py     Live positions, FX PnL, weekly performance\n│   ├── bourse_advanced_analytics.py  Sharpe, VaR, ES, beta, correlations\n│   ├── efficient_frontier.py   Portfolio optimization (scipy)\n│   ├── portfolio_backtest_service.py Current portfolio backtesting and improved allocation simulation\n│   ├── cashflow.py             Savings rate, passive income, cash flow KPIs\n│   ├── credits.py              Amortization schedules and real cost KPIs\n│   ├── snapshots*.py           Weekly wealth snapshot computation and rebuild\n│   ├── family_snapshots.py     Family-wide consolidated snapshots\n│   ├── projections.py          Goal-based projection engine (V1)\n│   ├── prevision*.py           Advanced projection engine (Monte Carlo, stress)\n│   ├── projection_service.py   Facade routing UI requests to the right engine\n│   ├── imports.py              CSV import pipeline\n│   ├── import_aliases_service.py Canonical import symbol aliases\n│   ├── import_history.py       Import batch tracking and rollback\n│   ├── import_lookup_service.py Shared lookup helpers for import UI\n│   ├── ticker_preview_service.py Live ticker validation and preview\n│   ├── tr_import.py            Trade Republic import pipeline\n│   ├── repositories.py         Generic CRUD data access\n│   └── db.py                   DB initialization, migrations, sqlite/libsql compat\n│\n├── utils/                      Shared formatting and validation helpers\n├── tests/                      30 test files (pytest)\n│\n├── docs/\n│   ├── ARCHITECTURE.md         Architecture reference (layering, data flows, debt)\n│   ├── SOURCE_DE_VERITE.md     Canonical KPI definitions by domain\n│   └── CONTEXT.md              Technical context and known deviations\n│\n├── scripts/\n│   └── patrimoine.spec         PyInstaller build spec\n│\n└── assets/\n    └── screenshots/            UI screenshots (see below)\n```\n\n---\n\n## Screenshots\n\n\u003e Screenshots coming soon.\n\u003e\n\u003e The app includes: family net worth dashboard, individual account panels (bank, brokerage, credit, real estate, private equity), projection charts, and a Sankey cash flow view.\n\n---\n\n## Known limitations\n\n- **Two projection engines coexist.** `services/projections.py` (goal-based, V1) and `services/prevision*.py` (Monte Carlo / stress, V2) are both active. `projection_service.py` routes between them. Consolidation is planned but not yet scheduled.\n- **FX conversion is not fully unified.** Weekly historical rates, live spot rates, and local helpers still use slightly different sources in some flows.\n- **Some analytics flows are still being consolidated.** The service layer is the source of truth, but older panels and compatibility facades are being progressively simplified.\n- **No mobile or web interface.** This is a local desktop application only.\n- **Trade Republic import requires manual 2FA.** The `pytr` integration prompts for authentication on first use.\n\n---\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for branch conventions, commit message format, and architecture rules.\n\nThe core rule: **all business logic lives in `services/` — the UI layer only handles display and interaction.**\n\n---\n\n## Contributors\n\n| Name | GitHub |\n|---|---|\n| Maxime Farre | [@MaximeFARRE](https://github.com/MaximeFARRE) |\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximefarre%2Fportfolio-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximefarre%2Fportfolio-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximefarre%2Fportfolio-tracker/lists"}