# iamsavitha/python-and-data_structure architecture

> Architecture diagram of the GitHub repository iamsavitha/python-and-data_structure, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/iamsavitha/python-and-data_structure
- Repository: https://github.com/iamsavitha/python-and-data_structure

## Overview

##### Project type and purpose
- This is an educational Python “Data Structures” repository. It hosts:
- Core algorithm implementations and exercises (Arrays, Data_Structure, recursion, regex)
- A hands-on lab (“Lab2”) that wraps a stock-prediction ML model in two user interfaces (Gradio and Streamlit)
- A “Libraries” folder containing NumPy-based notebooks and datasets

##### File structure
- Top‐level folders:
- Arrays/ – array.py, bst_wc.py, sample code
- Data_Structure/ – subfolders for List, Queue, Stack, LinkedList, sorting algorithms
- recursion/ – Recursion.py
- regex/ – a small regex homework project
- Lab2/ –
– app_Gradio.py, app_streamlit.py, stock_GUI.py (UI layers)
– stock_data.py (business logic)
– keras_model.h5, my_model.keras (trained models)
– .gradio folder with dataset1.csv, flags, certificates
– test_extract.ipynb
- Libraries/ – a NumPy-Project with its own notebooks and CSVs
- README.md at the root

##### README
- Confirms the repo’s focus: “Python_Data_Structure.”

##### Main components & interactions
a. Algorithm Modules (educational code – no external dependencies)
- Arrays, Data_Structure (List, Stack, etc.), recursion, regex
b. Lab2 ML Application
- UI Layer
– Gradio app (app_Gradio.py)
– Streamlit app (app_streamlit.py)
– Stock GUI (stock_GUI.py)
- Business Logic
– stock_data.py (data ingestion, preprocessing, inference calls)
- ML Models & Data
– keras_model.h5, my_model.keras
– Input CSVs in .gradio/flagged
– Any notebook tests (test_extract.ipynb)
c. Libraries Module
- NumPy Project notebooks & data (used for demonstrations)
d. Developer Environment
- Python interpreter, Jupyter, Gradio, Streamlit, required packages (implied by code)

Relationships & data flow
- User interacts with UI → UI calls business logic (stock_data.py) → logic loads model + data → returns predictions to UI
- Algorithm Modules are standalone examples, not linked at runtime to Lab2
- Libraries notebooks can import core code or use the same Python environment

##### Architectural patterns & design principles
- Layered architecture in Lab2: Presentation (UI) → Application Logic → Data/Models
- Modular “packages” for each data‐structure topic
- Separation of concerns: UI code separate from inference logic separate from model files

##### Elements
- Clear labels (e.g., “UI: app_Gradio.py / app_streamlit.py,” “Business Logic: stock_data.py,” “Models: keras_model.h5”)
- Blue – UI components
- Green – Business logic
- Orange – Data & models
- Purple – Educational algorithm modules

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    DevEnv["Developer Environment\n(Python, Jupyter, Gradio, Streamlit Packages)"]:::env

    %% Educational Modules
    subgraph "Educational Modules"
        ArraysModule["Arrays Module\n(array.py, bst_wc.py)"]:::edu
        DataStructure["Data_Structure Module\n(List, Queue, Stack, LinkedList, Sorting)"]:::edu
        RecursionModule["Recursion Module\n(Recursion.py)"]:::edu
        RegexModule["Regex Module\n(regex.py, phone.txt, logs.txt)"]:::edu
    end

    %% Lab2 Application
    subgraph "Lab2 Application"
        subgraph "UI Layer"
            Lab2UI_Gradio["Gradio App\n(app_Gradio.py)"]:::ui
            Lab2UI_Streamlit["Streamlit App\n(app_streamlit.py)"]:::ui
            Lab2UI_GUI["Stock GUI\n(stock_GUI.py)"]:::ui
        end
        subgraph "Business Logic Layer"
            Lab2Logic["Business Logic\n(stock_data.py)"]:::logic
        end
        subgraph "Data & Models Layer"
            Lab2Models["Models\n(keras_model.h5, my_model.keras)"]:::data
            Lab2Data["Dataset\n(dataset1.csv)"]:::data
            Lab2Notebook["Test Notebook\n(test_extract.ipynb)"]:::data
        end
    end

    %% Libraries Module
    subgraph "Libraries Module"
        Libraries["NumPy Project\n(Notebooks & CSVs)"]:::lib
    end

    %% Connections
    DevEnv --> ArraysModule
    DevEnv --> DataStructure
    DevEnv --> RecursionModule
    DevEnv --> RegexModule
    DevEnv --> Lab2UI_Gradio
    DevEnv --> Libraries

    Lab2UI_Gradio -->|calls| Lab2Logic
    Lab2UI_Streamlit -->|calls| Lab2Logic
    Lab2UI_GUI -->|calls| Lab2Logic
    Lab2Logic -->|loads| Lab2Models
    Lab2Logic -->|reads| Lab2Data

    %% Legend
    subgraph "Legend"
        direction LR
        E["Educational Modules"]:::edu
        U["UI Components"]:::ui
        L["Business Logic"]:::logic
        D["Data & Models"]:::data
        V["Developer Environment"]:::env
        B["Libraries Module"]:::lib
    end

    %% Click Events
    click ArraysModule "https://github.com/iamsavitha/python-and-data_structure/tree/main/Arrays/"
    click DataStructure "https://github.com/iamsavitha/python-and-data_structure/tree/main/Data_Structure/"
    click RecursionModule "https://github.com/iamsavitha/python-and-data_structure/blob/main/recursion/Recursion.py"
    click RegexModule "https://github.com/iamsavitha/python-and-data_structure/tree/main/regex/REGEX_Homework/"
    click Lab2UI_Gradio "https://github.com/iamsavitha/python-and-data_structure/blob/main/Lab2/app_Gradio.py"
    click Lab2UI_Streamlit "https://github.com/iamsavitha/python-and-data_structure/blob/main/Lab2/app_streamlit.py"
    click Lab2UI_GUI "https://github.com/iamsavitha/python-and-data_structure/blob/main/Lab2/stock_GUI.py"
    click Lab2Logic "https://github.com/iamsavitha/python-and-data_structure/blob/main/Lab2/stock_data.py"
    click Lab2Models "https://github.com/iamsavitha/python-and-data_structure/tree/main/Lab2/"
    click Lab2Data "https://github.com/iamsavitha/python-and-data_structure/blob/main/Lab2/.gradio/flagged/dataset1.csv"
    click Lab2Notebook "https://github.com/iamsavitha/python-and-data_structure/blob/main/Lab2/test_extract.ipynb"
    click Libraries "https://github.com/iamsavitha/python-and-data_structure/tree/main/Libraries/"

    %% Styles
    classDef env fill:#CCCCFF,stroke:#333,stroke-width:1px
    classDef edu fill:#E5CCFF,stroke:#333,stroke-width:1px
    classDef ui fill:#CCE5FF,stroke:#333,stroke-width:1px
    classDef logic fill:#CCFFCC,stroke:#333,stroke-width:1px
    classDef data fill:#FFE5CC,stroke:#333,stroke-width:1px
    classDef lib fill:#FFFFCC,stroke:#333,stroke-width:1px
```
