The Problem: Your Governance Officers and Risk Teams are flying blind. They have 50+ models in the inventory, but understanding the holistic "health" of that portfolio requires clicking through dozens of screens to check Security, Model, and Change controls manually.
The Solution: This automation engine connects directly to your ModelOp Center API, aggregates the Governance Score components, and generates a professional, high-fidelity PDF report suitable for review.
The Bigger Picture:
- For the Governance Team: You get an instant, auditable snapshot of compliance across the entire organization without manual data entry.
- For the Model Owner: You can visualize exactly where your models are failing (e.g., missing "Business Sponsor" or "Risk Rating") before an audit occurs.
Below is an example of the PDF report generated by this tool:
flowchart TD
Start([User Initiates Script]) -->|Reads| CONFIG[config.yaml]
CONFIG -->|Check| COOKIE{Valid Cookie?}
COOKIE -- No --> AUTH[Launch Selenium Browser]
AUTH -->|User Logs In| CAPTURE[Capture SESSION Cookie]
CAPTURE -->|Save| CONFIG
COOKIE -- Yes --> API_INV[Fetch Model Inventory]
API_INV -->|Loop Models| GET_SCORE[Fetch Governance Score]
GET_SCORE -->|Parse| AGG[Aggregate Controls]
AGG -->|Data| CSV[Export .csv]
AGG -->|Data| PDF[Generate .pdf Report]
PDF --> End([Report Ready])
.
├── generate_report.py # The Orchestrator (Main Script)
├── config.yaml # Control Center (Auth & Settings)
├── requirements.txt # Dependencies
└── output/ # Generated Reports
This tool runs locally as a client to the ModelOp Center ecosystem. You must configure the config.yaml file to point to your specific environment.
| Parameter | Description | Example |
|---|---|---|
base_url |
Your ModelOp Center API URL. | https://mocaasin.modelop.center/model-manage/api |
inventory_params |
Filters to determine which models to report on. | modelOrganization: "Finance", modelRisk: "HIGH" |
branding |
Hex codes to match your corporate identity in the PDF. | primary_green: "#006630" |
- Clone the Repository to your local machine.
- Install Dependencies using the provided requirements file. Note that we strictly require
reportlab<4.0for maximum compatibility.
pip install -r requirements.txt
Phase 1: Authentication
The script handles authentication automatically. If your session is expired, a Chrome window will open. Simply log in to ModelOp Center, and the script will grab your SESSION cookie and update config.yaml automatically.
Phase 2: Execution Run the reporter from your terminal.
python generate_report.py --config config.yaml
Phase 3: Analysis Two artifacts are generated in your folder:
- governance_score_data.csv: Raw data suitable for Tableau/PowerBI ingestion.
- governance_score_report.pdf: A visual dashboard with doughnut charts, calculating the aggregate pass/fail rates for Security, Model, and Change controls.
Context: 401 Unauthorized Loop.
Fix: The script attempts to auto-login, but if it fails, ensure you have Chrome installed. You can also manually paste a cookie into config.yaml.
Context: TypeError: 'usedforsecurity'...
Fix: This is a reportlab version mismatch. Run pip install "reportlab<4.0" to force the compatible version.
| Resource | Description | Link |
|---|---|---|
| Governance Score | Definition of the metric components. | View Glossary |
| Model Metadata | How metadata drives the score. | View Docs |
| Reporting API | API endpoints used for data retrieval. | View Docs |
