A comprehensive loan data validation and metrics engine using DuckDB.
Project description
Loan Analyzer
A lightweight, SQL-powered engine for validating loan data and computing analytical metrics using DuckDB.
Features
- Schema & Invariant Validation: Built-in SQL tests for uniqueness, reconciliation, principal tracking, and more.
- Recursive State Engine: Tracks monthly loan balances and interest accruals.
- Delinquency Waterfall: Computes Days Past Due (DPD) and classifies loans into delinquency buckets.
- DuckDB Powered: High-performance vectorized execution on local CSV files.
Installation
pip install .
Quick Start
from loan_analyzer import LoanDataLoader, LoanMetricsRunner
# 1. Load and Validate Data
loader = LoanDataLoader("path/to/your/csv_data")
loader.load_data()
is_valid, report = loader.validate()
# 2. Run Metrics
metrics = LoanMetricsRunner(loader)
metrics.run_loan_state()
metrics.run_delinquency()
SQL Resources
The package includes internal SQL resources located in:
src/loan_analyzer/sql/: Core metrics logic.src/loan_analyzer/tests/: Validation tests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
loan_analyzer-0.1.0.tar.gz
(6.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loan_analyzer-0.1.0.tar.gz.
File metadata
- Download URL: loan_analyzer-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac539ad5461e410f36edc12c1bdf86d5ac6d60205a5fa525b6286c204cac5655
|
|
| MD5 |
864a93fbe78903b13a9d34c2eceab1c5
|
|
| BLAKE2b-256 |
8bba0b710498c381b5e6ca788144da1b45661ecb4df9fafcbc503a7fee2282f1
|
File details
Details for the file loan_analyzer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: loan_analyzer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6adcdcfb8918580f479aea022e12a7972f4a3f4c1ac5760f96bdaa7c2862584
|
|
| MD5 |
1e7e96dbfc6ae18adc0260a2e26e4704
|
|
| BLAKE2b-256 |
1d047073b5b01b4c15e5fb28e571dfe43679a33aa4092d350b56df1a1ccf217f
|