# pranjal-joshi/screeni-py architecture

> Architecture diagram of the GitHub repository pranjal-joshi/screeni-py, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pranjal-joshi/screeni-py
- Repository: https://github.com/pranjal-joshi/screeni-py

## Overview

##### Main Components

a) Frontend Layer:
- Streamlit Web Interface (src/streamlit_app.py)
- CLI Interface (src/screenipy.py)

b) Core Processing Layer:
- Screener Engine (src/classes/Screener.py)
- Technical Analysis Module (src/classes/ScreenipyTA.py)
- Machine Learning Models (src/ml/)
- Parallel Processing Module (src/classes/ParallelProcessing.py)

c) Data Layer:
- Data Fetcher (src/classes/Fetcher.py)
- Configuration Management (src/classes/ConfigManager.py)
- Stock Data Cache (actions-data-download/)

d) External Services:
- NSE Data Source
- Trading View Integration
- Docker Container Environment

**[User Interface Layer]**

- Web UI (Streamlit)
- CLI Interface

**[Core Processing Layer]**

- Screener Engine
- Pattern Recognition
- Technical Indicators
- Signal Generation

- ML Processing
- Model Inference
- Prediction Engine

- Parallel Processing

**[Data Management Layer]**

- Data Fetcher
- NSE API Client
- Cache Manager

- Configuration Manager

**[External Services]**

- NSE Data Source
- TradingView Integration

##### Key Relationships to Highlight

- Data flow from NSE to Data Fetcher
- Parallel processing of stock data
- Integration with ML models for predictions
- Configuration management affecting all layers
- Cache system interaction with data fetcher
- User interface options (Web/CLI) connecting to core engine

##### Technical Stack Indicators

- Python as primary language
- Streamlit for web interface
- TA-Lib for technical analysis
- Machine Learning frameworks (indicated by .h5 files)
- Docker containerization

##### Additional Elements

- Version control integration
- Automated workflow connections
- Test coverage paths
- OTA update pathways

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef container fill:#e74c3c,stroke:#c0392b,color:white

    %% Docker Container
    subgraph Docker["Docker Environment"]
        %% User Interface Layer
        subgraph UI["User Interface Layer"]
            WebUI["Streamlit Web Interface"]
            CLI["CLI Interface"]
        end

        %% Core Processing Layer
        subgraph Core["Core Processing Layer"]
            ScreenerEngine["Screener Engine"]
            TechAnalysis["Technical Analysis"]
            ParallelProc["Parallel Processing"]
            
            subgraph ML["Machine Learning"]
                MLModels["ML Models"]
                PredEngine["Prediction Engine"]
            end

            subgraph Pattern["Pattern Analysis"]
                PatternRec["Pattern Recognition"]
                SignalGen["Signal Generation"]
            end
        end

        %% Data Management Layer
        subgraph Data["Data Management Layer"]
            DataFetch["Data Fetcher"]
            Config["Configuration Manager"]
            Cache["Stock Data Cache"]
            OTA["OTA Updates"]
            Utils["Utility Functions"]
        end
    end

    %% External Services
    subgraph External["External Services"]
        NSE["NSE Data Source"]
        TradingView["TradingView Integration"]
    end

    %% Relationships
    WebUI --> ScreenerEngine
    CLI --> ScreenerEngine
    ScreenerEngine --> TechAnalysis
    ScreenerEngine --> ParallelProc
    ScreenerEngine --> Pattern
    ParallelProc --> DataFetch
    TechAnalysis --> MLModels
    MLModels --> PredEngine
    DataFetch --> NSE
    DataFetch --> TradingView
    DataFetch --> Cache
    Config --> ScreenerEngine
    Config --> DataFetch
    OTA --> Config

    %% Click Events
    click WebUI "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/streamlit_app.py"
    click CLI "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/screenipy.py"
    click ScreenerEngine "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/Screener.py"
    click TechAnalysis "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/ScreenipyTA.py"
    click MLModels "https://github.com/pranjal-joshi/Screeni-py/tree/main/src/ml/"
    click ParallelProc "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/ParallelProcessing.py"
    click DataFetch "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/Fetcher.py"
    click Config "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/ConfigManager.py"
    click Cache "https://github.com/pranjal-joshi/Screeni-py/tree/main/actions-data-download/"
    click Docker "https://github.com/pranjal-joshi/Screeni-py/tree/main/Dockerfile"
    click PatternRec "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/CandlePatterns.py"
    click OTA "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/OtaUpdater.py"
    click Utils "https://github.com/pranjal-joshi/Screeni-py/blob/main/src/classes/Utility.py"

    %% Style Applications
    class WebUI,CLI ui
    class ScreenerEngine,TechAnalysis,ParallelProc,MLModels,PredEngine,Pattern,PatternRec,SignalGen core
    class DataFetch,Config,Cache,OTA,Utils data
    class NSE,TradingView external
    class Docker container
```
