Personal Finance ETL
Local-first financial data engineering & quantitative decision-support lakehouse platform.
Preserve financial evidence → Canonicalize meaning → Reconstruct state → Reconcile against reality → Support decisions across Investments, Tax, Household, and FIRE.
Architecture
PFETL implements a durable, local-first Lakehouse architecture combining an ACID SQLite Control Plane with high-throughput DuckDB analytical query processing:
flowchart TD
subgraph EVIDENCE["1 · Financial Evidence"]
HH["Household SQLite Records"]
BRK["Broker Statements & Trade Books"]
MKT["Market Quotes & Benchmarks"]
FX["Daily FX Rate Feeds"]
end
subgraph CONTROL["2 · Control Plane & Raw Store"]
CP[("SQLite Control Plane\ncp_file_registry · cp_runs · payloads")]
BRONZE[("Persistent Bronze Lakehouse\n20 source data contracts")]
end
subgraph CANON["3 · Harmonization & Identity"]
DAG["Polars Transformation DAG"]
SILVER[("Canonical Silver Lakehouse\n24 entity data contracts")]
end
subgraph DOMAIN["4 · Financial Quantitative Engines"]
FIFO["Investment FIFO Engine\nLots · Disposals · Realized PnL"]
TAX["Tax Evidence Engine\nLTCG / STCG · Exemption Ladders"]
WEALTH["Wealth & FI Engine\nAttribution · SWR"]
MC["FIRE Simulation Engine\nMonte Carlo · Shocks"]
end
subgraph PUBLISH["5 · Decision-Support Publication"]
GOLD[("Analytical Gold Lakehouse\n22 analytical decision marts")]
META[("DuckDB Meta Schema\nFingerprints · Telemetry")]
end
subgraph CONSUME["6 · Presentation & Analytics"]
CLI["Operator CLI (pfetl)"]
DESK["CustomTkinter Desktop App"]
BI["Power BI / Downstream Analytics"]
end
EVIDENCE --> CP
CP --> BRONZE
BRONZE --> DAG
DAG --> SILVER
SILVER --> DOMAIN
DOMAIN --> GOLD
DOMAIN --> META
GOLD --> CONSUME
Core Capabilities
| Financial Domain | Engineering Responsibility & Analytical Guarantee |
|---|---|
| Household Ledger | Multi-account ingestion, categorization DAG, transfer elimination, and exact cashflow identity verification ($\Delta\text{Cash} \equiv \text{Income} - \text{Expenses}$). |
| Investment Accounting | Multi-currency order matching, exact chronological lot depletion, corporate action adjustments, and realized gain/loss attribution. |
| Valuation & Performance | T+0 daily valuation, multi-asset class allocation, benchmark active returns (Nifty 50, S&P 500), currency conversion, and annual XIRR computation. |
| Tax Evidence | Holding period determination (equity, debt, international), Section 112A/111A classification, indexation grandfathering, and tax-loss harvesting ladders. |
| Wealth & FIRE Analytics | Net worth attribution ($\Delta \text{Net Worth} \equiv \text{Net Cashflow} + \text{Investment Return}$), safe withdrawal rates (SWR), and Monte Carlo simulation regimes. |
| Operational Durability | SQLite Control Plane provenance tracking, DuckDB ACID transactions, non-blocking JSONL forensic logs, and coordinated point-in-time snapshot/restore. |
Installation & Setup
PFETL targets Python 3.13+ on Windows, macOS, and Linux:
# Clone the repository
git clone https://github.com/tks18/personal-finance-etl.git
cd personal-finance-etl
# Option A: Install with uv (recommended)
uv sync
# Option B: Install with pip
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
Operator CLI (pfetl)
# Run the complete quantitative pipeline
pfetl run --config config.toml --rules rules.toml
# Execute actionable system diagnostics and environment health checks
pfetl doctor
# Launch the desktop graphical interface
pfetl gui
# Create an atomic, coordinated database snapshot archive
pfetl backup
# Restore databases from a snapshot archive
pfetl restore backup_archive.zip
Desktop Application
The CustomTkinter desktop interface provides a local-first workspace organized into four unified tabs:
- ▶ Pipeline Run: One-click pipeline execution, real-time progress bar, live narrative console, and instant database snapshot/restore actions.
- ⚙️ Configuration: Visual interactive editors for
config.toml(Settings) andrules.toml(Financial Rules), with in-place schema validation, type enforcement, and dynamic parameter lists. - 📋 Forensic Logs: Dual-pane diagnostic suite featuring real-time execution narrative, JSONL forensic trace selection, multi-dimensional filters (severity, stage, search), and deep execution context inspector.
- 🩺 System & Health: Live operational status indicators, warehouse table contract counters, native directory launchers, and on-demand Doctor diagnostics runner.
Lakehouse Data Contracts
PFETL publishes structured datasets across three distinct Medallion lakehouse layers:
- Bronze (20 Tables): Raw, unmutated financial evidence preserved with cryptographic source file hashes, timestamps, and payload lineage.
- Silver (24 Tables): Cleaned, type-coerced, and canonicalized financial entities published with deterministic UUID surrogate keys.
- Gold (22 Marts): Reconciled analytical decision marts ready for financial planning, balance sheet reporting, and quantitative decision-support.
Operational Reliability
- Dual-Database Storage Model: Fast analytical queries execute inside embedded DuckDB, while ACID transactional durability, file deduplication, and execution metadata reside in SQLite.
- Atomic Two-Phase Commits: DuckDB lakehouse tables are committed first, followed by SQLite run states, preventing partial disk states.
- Non-Blocking Observability: Structured JSONL forensic logging is decoupled from analytical execution via background queue sinks, protecting GUI responsiveness.
- Self-Healing Recovery: Stale or interrupted runs are automatically detected on startup and cleanly reconciled or rolled back.
Testing & Quality Confidence
The test suite enforces mathematical correctness through deterministic, synthetic test fixtures with hand-checkable analytical assertions:
# Run the complete test suite
pytest -v
# Run linters and static type verification
ruff check src tests
mypy src tests
pyright src tests
pylint src/personal_finance_etl
Downstream Analytics
PFETL serves as the authoritative, local-first analytical lakehouse producer. The published Gold marts in DuckDB can be queried directly via ODBC/JDBC from Microsoft Power BI, Excel, Jupyter Notebooks, or downstream analytical applications.
License & Authorship
Authored by Shan. Distributed under the GNU General Public License v3.0 (GPL-3.0).
Metadata
Release files for personal-finance-etl 12.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| personal_finance_etl-12.0.0.tar.gz | 1.0 MB | With provenance | Details for personal_finance_etl-12.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| personal_finance_etl-12.0.0-py3-none-any.whl | Python 3 | none | any | Details for personal_finance_etl-12.0.0-py3-none-any.whl |
Total release size: 1.9 MB
Release files / personal_finance_etl-12.0.0.tar.gz
| Download URL | personal_finance_etl-12.0.0.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7865f1591442f7a968219eb4267f29417f754dd5ea938ff9027ec773c448a6c1
|
|
BLAKE2b-256 checksum How to use checksums |
3688d5785903a4d4b48e6bf9b031787b1224e2a939d86d51faf8ac1a32853dd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / personal_finance_etl-12.0.0-py3-none-any.whl
| Download URL | personal_finance_etl-12.0.0-py3-none-any.whl |
|---|---|
| Size | 837.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71f3167c37ade0fe1582ed839cdcd59d07b227a958f6dcf1896dd313f22569c4
|
|
BLAKE2b-256 checksum How to use checksums |
536138a04ca697e16e11c7b9614bda9d30bf07adca0b8bb222bb9886cf74f8e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for personal-finance-etl 12.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for personal_finance_etl-12.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.