# manddar/open-interest-data-extractor architecture

> Architecture diagram of the GitHub repository manddar/open-interest-data-extractor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manddar/open-interest-data-extractor
- Repository: https://github.com/manddar/open-interest-data-extractor

## Overview

##### Project type and purpose
- This is a small CLI “data extractor” tool written in Python.
- Purpose: fetch the Option Chain data from the NSE official API, parse it, and display it in a tabular format on the console.

##### File structure
- Top level:
- `.gitignore` – standard VCS ignore file
- `README.md` – project overview and instructions
- `main.py` – the entire application lives here
- No separate “src”, “tests”, or config directories—everything is in one script.

##### README for additional insights
- Dependencies: `requests` (for HTTP calls)
- Usage hints: should run without a VPN; future plans include exception handling, JSON output, and code restructuring.

##### Detailed but concise
- Logical step in the pipeline as its own component.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Invocation
    User["User"]:::external -->|"runs"| CLI["CLI Entry Point\n(main.py)"]:::internal

    %% Pipeline Subgraph
    subgraph "Data Extraction Pipeline"
        direction TB
        HTTP["HTTP Client\n(requests)"]:::internal
        API["NSE Option Chain API"]:::external
        Parser["Data Parser/Formatter"]:::internal
        Formatter["Console Renderer\n(tabular output)"]:::internal
    end

    %% Flow
    CLI -->|"fetch data"| HTTP
    HTTP -->|"GET /option-chain"| API
    API -->|"JSON response"| HTTP
    HTTP -->|"raw JSON"| Parser
    Parser -->|"parsed data"| Formatter
    Formatter -->|"pretty table"| Console["Console Output"]:::output

    %% Future Extensions
    CLI -.->|“wrap calls”| Exception["Exception Handler"]:::future
    CLI -.->|“serialize”| JSON["JSON Output Module"]:::future

    %% Click Events
    click CLI "https://github.com/manddar/open-interest-data-extractor/blob/main/main.py"
    click HTTP "https://github.com/manddar/open-interest-data-extractor/blob/main/main.py"
    click Parser "https://github.com/manddar/open-interest-data-extractor/blob/main/main.py"
    click Formatter "https://github.com/manddar/open-interest-data-extractor/blob/main/main.py"

    %% Styles
    classDef internal fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef external fill:#FFD580,stroke:#333,stroke-width:1px
    classDef output fill:#90EE90,stroke:#333,stroke-width:1px
    classDef future fill:#D3D3D3,stroke-dasharray: 5 5,stroke:#333
```
