# bhupesh-debug/financialanalyst architecture

> Architecture diagram of the GitHub repository bhupesh-debug/financialanalyst, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhupesh-debug/financialanalyst
- Repository: https://github.com/bhupesh-debug/financialanalyst
- Video tour (about a minute): https://gitdiagram.com/bhupesh-debug/financialanalyst/video

## Overview

This is a portfolio and execution toolkit for commercial-real-estate capital-markets analysis. Its central analytical workflow builds property cash flows, sizes debt against lender constraints, and tests scenarios; scripts expose workbook and console outputs. Separate deal-operations tools track pipeline activity, manage lender outreach, and compare quotes, while Markdown templates support broker, lender, and risk communications. The README documents these capabilities, and sampled code confirms key model relationships. Some template and automation internals were not sampled, so their connections are not inferred.

Main entry points: [`models/sensitivity_analysis.py`](https://github.com/bhupesh-debug/financialanalyst/blob/main/models/sensitivity_analysis.py) (Sensitivity Analysis), [`scripts/generate_deal_model.py`](https://github.com/bhupesh-debug/financialanalyst/blob/main/scripts/generate_deal_model.py) (Excel Model Generator), [`scripts/run_sensitivity.py`](https://github.com/bhupesh-debug/financialanalyst/blob/main/scripts/run_sensitivity.py) (Sensitivity Runner), [`models/cre_deal_model.py`](https://github.com/bhupesh-debug/financialanalyst/blob/main/models/cre_deal_model.py) (Property Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_underwriting["Deal Underwriting"]
  node_deal_model["Property Model<br/>[cre_deal_model.py]"]
  node_debt_sizing["Debt Sizing"]
  node_model_generator["Excel Model Generator"]
end

subgraph group_analysis["Scenario Analysis"]
  node_sensitivity["Sensitivity Analysis"]
  node_sensitivity_runner["Sensitivity Runner<br/>[run_sensitivity.py]"]
end

subgraph group_operations["Deal Operations"]
  node_deal_tracker[("Deal Pipeline Tracker<br/>[deal_tracker.py]")]
  node_lender_outreach[("Lender Outreach<br/>[lender_outreach.py]")]
  node_quote_updater["Quote Matrix Updater"]
end

subgraph group_communications["Deal Communications"]
  node_om_template["Offering Memorandum"]
  node_quote_template["Lender Quote Matrix"]
  node_risk_template["Appraisal Risk Review"]
  node_update_template["Broker Updates"]
  node_gap_guidance["CRE Skill Guidance<br/>[01_gap_analysis.md]"]
end

node_analyst(("Analyst"))

node_analyst -->|"runs generator"| node_model_generator
node_analyst -->|"runs analysis"| node_sensitivity_runner
node_model_generator -->|"builds model"| node_deal_model
node_model_generator -->|"runs scenarios"| node_sensitivity
node_sensitivity -->|"uses model"| node_deal_model
node_sensitivity -->|"sizes scenarios"| node_debt_sizing
node_sensitivity_runner -->|"runs analysis"| node_sensitivity
node_analyst -->|"tracks deals"| node_deal_tracker
node_analyst -->|"manages outreach"| node_lender_outreach
node_analyst -->|"compares quotes"| node_quote_updater

click node_deal_model "https://github.com/bhupesh-debug/financialanalyst/blob/main/models/cre_deal_model.py"
click node_debt_sizing "https://github.com/bhupesh-debug/financialanalyst/blob/main/models/debt_sizing_engine.py"
click node_model_generator "https://github.com/bhupesh-debug/financialanalyst/blob/main/scripts/generate_deal_model.py"
click node_sensitivity "https://github.com/bhupesh-debug/financialanalyst/blob/main/models/sensitivity_analysis.py"
click node_sensitivity_runner "https://github.com/bhupesh-debug/financialanalyst/blob/main/scripts/run_sensitivity.py"
click node_deal_tracker "https://github.com/bhupesh-debug/financialanalyst/blob/main/automation/deal_tracker.py"
click node_lender_outreach "https://github.com/bhupesh-debug/financialanalyst/blob/main/automation/lender_outreach.py"
click node_quote_updater "https://github.com/bhupesh-debug/financialanalyst/blob/main/automation/quote_matrix_updater.py"
click node_om_template "https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/offering_memorandum.md"
click node_quote_template "https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/lender_quote_matrix.md"
click node_risk_template "https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/appraisal_risk_review.md"
click node_update_template "https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/weekly_broker_update.md"
click node_gap_guidance "https://github.com/bhupesh-debug/financialanalyst/blob/main/docs/01_gap_analysis.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_deal_model,node_debt_sizing,node_model_generator toneBlue
class node_sensitivity,node_sensitivity_runner toneAmber
class node_deal_tracker,node_lender_outreach,node_quote_updater toneMint
class node_om_template,node_quote_template,node_risk_template,node_update_template,node_gap_guidance toneRose
class node_analyst toneIndigo
```

## Components

### Deal Underwriting

- [Property Model](https://github.com/bhupesh-debug/financialanalyst/blob/main/models/cre_deal_model.py): `models/cre_deal_model.py`
- [Debt Sizing](https://github.com/bhupesh-debug/financialanalyst/blob/main/models/debt_sizing_engine.py): `models/debt_sizing_engine.py`
- [Excel Model Generator](https://github.com/bhupesh-debug/financialanalyst/blob/main/scripts/generate_deal_model.py): `scripts/generate_deal_model.py`

### Scenario Analysis

- [Sensitivity Analysis](https://github.com/bhupesh-debug/financialanalyst/blob/main/models/sensitivity_analysis.py): `models/sensitivity_analysis.py`
- [Sensitivity Runner](https://github.com/bhupesh-debug/financialanalyst/blob/main/scripts/run_sensitivity.py): `scripts/run_sensitivity.py`

### Deal Operations

- [Deal Pipeline Tracker](https://github.com/bhupesh-debug/financialanalyst/blob/main/automation/deal_tracker.py): `automation/deal_tracker.py`
- [Lender Outreach](https://github.com/bhupesh-debug/financialanalyst/blob/main/automation/lender_outreach.py): `automation/lender_outreach.py`
- [Quote Matrix Updater](https://github.com/bhupesh-debug/financialanalyst/blob/main/automation/quote_matrix_updater.py): `automation/quote_matrix_updater.py`

### Deal Communications

- [Offering Memorandum](https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/offering_memorandum.md): `templates/offering_memorandum.md`
- [Lender Quote Matrix](https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/lender_quote_matrix.md): `templates/lender_quote_matrix.md`
- [Appraisal Risk Review](https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/appraisal_risk_review.md): `templates/appraisal_risk_review.md`
- [Broker Updates](https://github.com/bhupesh-debug/financialanalyst/blob/main/templates/weekly_broker_update.md): `templates/weekly_broker_update.md`
- [CRE Skill Guidance](https://github.com/bhupesh-debug/financialanalyst/blob/main/docs/01_gap_analysis.md): `docs/01_gap_analysis.md`

### Other components

- **Analyst**

## Connections

- Analyst → Excel Model Generator: runs generator (evidence: `README.md`)
- Analyst → Sensitivity Runner: runs analysis (evidence: `README.md`)
- Excel Model Generator → Property Model: builds model (evidence: `scripts/generate_deal_model.py`)
- Excel Model Generator → Sensitivity Analysis: runs scenarios (evidence: `scripts/generate_deal_model.py`)
- Sensitivity Analysis → Property Model: uses model (evidence: `models/sensitivity_analysis.py`)
- Sensitivity Analysis → Debt Sizing: sizes scenarios (evidence: `models/sensitivity_analysis.py`)
- Sensitivity Runner → Sensitivity Analysis: runs analysis (evidence: `scripts/run_sensitivity.py`)
- Analyst → Deal Pipeline Tracker: tracks deals (evidence: `README.md`)
- Analyst → Lender Outreach: manages outreach (evidence: `README.md`)
- Analyst → Quote Matrix Updater: compares quotes (evidence: `README.md`)
