# sarguna01/ai-analyser architecture

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

- Interactive diagram: https://gitdiagram.com/sarguna01/ai-analyser
- Repository: https://github.com/sarguna01/ai-analyser

## Overview

This repository combines an interactive NSE stock screener with a separate daily equity-list tracker. The screener offers live and simulated modes, filters and scores stocks, and displays ratings; the tracker downloads official listings, saves dated snapshots, and reports newly listed symbols. The checked-in CSVs are data artifacts. The screener excerpt omits most of its orchestration, so its internal stage connections are not asserted; the tracker’s visible calls support a clearer flow.

Main entry points: [`updatestocksdaily.py`](https://github.com/sarguna01/ai-analyser/blob/main/updatestocksdaily.py) (Daily tracker), [`nse_data/nse_equity_list_2026-08-06.csv`](https://github.com/sarguna01/ai-analyser/blob/main/nse_data/nse_equity_list_2026-08-06.csv) (Equity snapshots), [`stockscreener.py`](https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py) (Stock universe)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screen["Stock screening"]
  node_screener["Screening CLI<br/>[stockscreener.py]"]
  node_universe["Stock universe<br/>[stockscreener.py]"]
  node_quotes["Quote retrieval<br/>[stockscreener.py]"]
  node_filters["Stock filters<br/>[stockscreener.py]"]
  node_scoring["Stock scoring<br/>[stockscreener.py]"]
  node_display["Ratings display<br/>[stockscreener.py]"]
end

subgraph group_tracker["Listing tracker"]
  node_updater["Daily tracker"]
  node_fetch["List fetch"]
  node_diff["Listing comparison"]
end

subgraph group_data["Data artifacts"]
  node_snapshots[("Equity snapshots")]
  node_screener_csv["Screener output"]
  node_equity_csv["Equity list input"]
end

node_user(("Operator"))
node_nse["NSE services"]
node_yahoo["Yahoo Finance"]

node_user -->|"runs"| node_screener
node_user -->|"runs"| node_updater
node_quotes -->|"fetches quotes"| node_yahoo
node_universe -->|"requests listings"| node_nse
node_fetch -->|"downloads list"| node_nse
node_updater -->|"calls"| node_fetch
node_updater -->|"saves snapshot"| node_snapshots
node_updater -->|"compares listings"| node_diff
node_diff -->|"reads prior list"| node_snapshots
node_updater -->|"writes new listings"| node_equity_csv

click node_screener "https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py"
click node_universe "https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py"
click node_quotes "https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py"
click node_filters "https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py"
click node_scoring "https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py"
click node_display "https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py"
click node_updater "https://github.com/sarguna01/ai-analyser/blob/main/updatestocksdaily.py"
click node_fetch "https://github.com/sarguna01/ai-analyser/blob/main/updatestocksdaily.py"
click node_diff "https://github.com/sarguna01/ai-analyser/blob/main/updatestocksdaily.py"
click node_snapshots "https://github.com/sarguna01/ai-analyser/blob/main/nse_data/nse_equity_list_2026-08-06.csv"
click node_screener_csv "https://github.com/sarguna01/ai-analyser/blob/main/Full_NSE_Screener_20260806_0606.csv"
click node_equity_csv "https://github.com/sarguna01/ai-analyser/blob/main/nse_data/nse_equity_list_2026-08-06.csv"

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_screener,node_universe,node_quotes,node_filters,node_scoring,node_display toneBlue
class node_updater,node_fetch,node_diff toneAmber
class node_snapshots,node_screener_csv,node_equity_csv toneMint
class node_user,node_nse,node_yahoo toneIndigo
```

## Components

### Stock screening

- [Screening CLI](https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py): `stockscreener.py`
- [Stock universe](https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py): `stockscreener.py`
- [Quote retrieval](https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py): `stockscreener.py`
- [Stock filters](https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py): `stockscreener.py`
- [Stock scoring](https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py): `stockscreener.py`
- [Ratings display](https://github.com/sarguna01/ai-analyser/blob/main/stockscreener.py): `stockscreener.py`

### Listing tracker

- [Daily tracker](https://github.com/sarguna01/ai-analyser/blob/main/updatestocksdaily.py): `updatestocksdaily.py`
- [List fetch](https://github.com/sarguna01/ai-analyser/blob/main/updatestocksdaily.py): `updatestocksdaily.py`
- [Listing comparison](https://github.com/sarguna01/ai-analyser/blob/main/updatestocksdaily.py): `updatestocksdaily.py`

### Data artifacts

- [Equity snapshots](https://github.com/sarguna01/ai-analyser/blob/main/nse_data/nse_equity_list_2026-08-06.csv): `nse_data/nse_equity_list_2026-08-06.csv`
- [Screener output](https://github.com/sarguna01/ai-analyser/blob/main/Full_NSE_Screener_20260806_0606.csv): `Full_NSE_Screener_20260806_0606.csv`
- [Equity list input](https://github.com/sarguna01/ai-analyser/blob/main/nse_data/nse_equity_list_2026-08-06.csv): `nse_data/nse_equity_list_2026-08-06.csv`

### Other components

- **Operator**
- **NSE services**
- **Yahoo Finance**

## Connections

- Operator → Screening CLI: runs (evidence: `stockscreener.py`)
- Operator → Daily tracker: runs (evidence: `updatestocksdaily.py`)
- Quote retrieval → Yahoo Finance: fetches quotes (evidence: `stockscreener.py`)
- Stock universe → NSE services: requests listings (evidence: `stockscreener.py`)
- List fetch → NSE services: downloads list (evidence: `updatestocksdaily.py`)
- Daily tracker → List fetch: calls (evidence: `updatestocksdaily.py`)
- Daily tracker → Equity snapshots: saves snapshot (evidence: `updatestocksdaily.py`)
- Daily tracker → Listing comparison: compares listings (evidence: `updatestocksdaily.py`)
- Listing comparison → Equity snapshots: reads prior list (evidence: `updatestocksdaily.py`)
- Daily tracker → Equity list input: writes new listings (evidence: `updatestocksdaily.py`)
