Loan portfolio analytics

A clearer view
of the loan book.

Exposure, delinquency and credit quality in one calm, local workspace — with documented metrics and visible data checks.

PythonStreamlitPandasPlotlySQLite

Portfolio overview Seeded demo workspace
Northstar portfolio overview showing total loans, outstanding balance, overdue loans, default rate and origination activity.
One connected view of exposure, risk and data quality.
1,600 Seeded loans
18 Month-end snapshots
15 Data-quality controls
5 Focused workspaces

01 / Workspace

One loan book,
read from several angles.

Start with the whole portfolio, then move down to the loans that need attention. Every view shares the same filters and the same SQL definitions.

01 Exposure

See the shape of the book.

Outstanding mix, origination pace and borrower concentration sit together. Compare products, segments and counterparties without losing the whole-book context.

02 Credit risk

Understand how risk is forming.

Read arrears by ageing bucket, grade and completed vintage. PAR metrics keep their denominator in view, so a change in risk is not confused with a change in mix.

03 Assurance

Check the data before the story.

Duplicates, orphan records, missing fields and impossible values are surfaced before the portfolio numbers reach a committee.

02 / Risk & delinquency

Risk, with its context intact.

Distinguish early arrears from late-stage exposure. Northstar brings the distribution, severity and cohort view together without flattening them into a single score.

  • PAR 30 / 60 / 90
  • Balance-based default by grade
  • Days-past-due distribution
  • Completed-vintage quality
Read the metric definitions
Northstar risk and delinquency view showing PAR, 90+ DPD exposure, DPD distribution, default by risk grade and vintage performance.
Risk & delinquency Seeded portfolio · completed vintages
Northstar data quality view showing passed validation controls and critical field completeness.
Data quality Full-database audit · expected blanks made explicit

03 / Data quality

Confidence starts
before the chart.

Fifteen controls run against the complete database, independent of the dashboard filters. The validation list and field completeness profile sit beside the portfolio so the quality of the underlying record is never assumed.

15/15 controls passed
23 critical fields covered
21,972 rows audited
Read the data quality guide

04 / Under the hood

A small system,
deliberately.

A Streamlit interface, a filter-aware SQL layer and one SQLite file. The data path stays visible, the metric definitions stay legible and the demo has no hidden services.

01

SQL does the analysis.

Every view starts with a parameterized query over a joined loan view.

02

Presentation stays separate.

Pandas shapes result sets; Plotly and a small custom CSS system present them.

03

The book is portable.

One SQLite database holds loans, customers and month-end snapshots.

Read the architecture notes
analytics.sql parameterized
-- current exposure by product
SELECT
    d.loan_type,
    SUM(d.outstanding_balance) AS outstanding
FROM loan_details AS d
WHERE d.status != 'Closed'
GROUP BY d.loan_type
ORDER BY outstanding DESC;
SQL-backed metrics SQLite · WAL

Run locally

The demo book is included.

No API keys. No external warehouse. Generate the seeded portfolio, start the app and open a complete lending analytics workspace on your machine.

Python 3.11+ · macOS / Linux commands · Windows activation is in the README.

Terminal
local
git clone https://github.com/Mo-Shakib/Northstar.git
cd Northstar
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python init_db.py
streamlit run app.py
Synthetic portfolio · SQLite No external services