# rakesh-myana/mark-sheet-generator architecture

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

- Interactive diagram: https://gitdiagram.com/rakesh-myana/mark-sheet-generator
- Repository: https://github.com/rakesh-myana/mark-sheet-generator

## Overview

##### Main Components
a. Python Script (xlsheet.py): This is the core of the project where the orchestration happens.
b. Web Automation Module: Using Selenium, this component handles browser interactions to navigate, input roll numbers, and scrape result data from the JNTUH Results website.
c. Excel Generation Module: Utilizing xlsxwriter, this module takes the scraped data and organizes it into an Excel sheet.
d. External Dependencies:
- Selenium WebDriver: Controlled via the chromedriver (chromedriver.exe and possibly LICENSE.chromedriver) to interact with the dynamic content on the website.
- JNTUH Results Website: An external system being scraped for data.
e. Data Flow Input: The roll numbers which serve as input for data retrieval.

##### Relationships and Interactions
- The Python script (xlsheet.py) acts as the main controller.
- It initiates the Selenium WebDriver to load the external website.
- The Web Automation component (built into the script using Selenium) navigates to the results website and inputs individual roll numbers, waiting for the dynamic elements (using explicit waits) to load.
- Once the required data (student name, roll number, semester SGPA, and overall CGPA) is retrieved using appropriate XPath/CSS selectors, it is then passed to the Excel Generation module.
- The data is then organized and written into an Excel file using xlsxwriter.

##### Architectural Patterns and Technology Choices
- Web Scraping with Selenium: Use of explicit waits and dynamic locator strategies indicates thoughtful handling of asynchronous web content.
- Data Processing and Storage: Data is transformed into a structured format (Excel) using a library designed specifically for that purpose.
- The design demonstrates a linear data pipeline: Input (Roll Numbers) → Web Automation (Data Retrieval) → Data Processing (Extraction & Transformation) → Data Output (Excel Sheet).

a. Component Labels:
- "Python Script (xlsheet.py)"
- "Selenium WebDriver (chromedriver.exe)"
- "JNTUH Results Website" (marked as an external system)
- "Excel Generation (xlsxwriter)"
b. Data Flow Direction:
- From "Python Script" → launch Selenium WebDriver.
- From "Selenium WebDriver" → interact with "JNTUH Results Website".
- Data flows back from "JNTUH Results Website" to "Selenium WebDriver".
- "Selenium WebDriver" → passes the retrieved data to "Excel Generation".
c. Additional Elements:
- “Input Roll Numbers” as an initial step/data source feeding into the "Python Script" module.
- Any intermediate error handling or retry logic can be briefly noted if necessary.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A("Input Roll Numbers"):::input
    B("Python Script (xlsheet.py)"):::internal
    
    subgraph "Selenium WebDriver"
        C1("chromedriver.exe"):::automation
        C2("LICENSE.chromedriver"):::automation
    end
    
    D("JNTUH Results Website"):::external
    E("Excel Generation (xlsxwriter)"):::internal

    A -->|"provides_input"| B
    B -->|"initiates_browser_action"| C1
    C1 -->|"sends_request"| D
    D -->|"returns_data"| C1
    C1 -->|"passes_data"| E

    click B "https://github.com/rakesh-myana/mark-sheet-generator/blob/main//xlsheet.py"
    click C1 "https://github.com/rakesh-myana/mark-sheet-generator/blob/main//chromedriver.exe"
    click C2 "https://github.com/rakesh-myana/mark-sheet-generator/blob/main//LICENSE.chromedriver"
    click E "https://github.com/rakesh-myana/mark-sheet-generator/blob/main//Marks_sheet.xlsx"

    classDef internal fill:#f9f,stroke:#333,stroke-width:2px;
    classDef automation fill:#ff9,stroke:#333,stroke-width:2px;
    classDef external fill:#bbf,stroke:#333,stroke-width:2px;
    classDef input fill:#afa,stroke:#333,stroke-width:2px;
```
