# okr3vl/osgifi architecture

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

- Interactive diagram: https://gitdiagram.com/okr3vl/osgifi
- Repository: https://github.com/okr3vl/osgifi

## Overview

##### Project type and purpose
- This is an open-source Python CLI tool (“OSGIFI”) for discovering and gathering public and some hidden information from Instagram accounts.
- The tool is installed as a Python package and invoked via a command-line entrypoint (`OSGIFI -u username -s sessionid`).

##### File structure
- Top-level files:
- LICENSE, README.md – documentation
- SetUp.py – installer script (defines entry point)
- Package directory: `OSGIFI/`
- `__init__.py` – package marker
- `main.py` – CLI entrypoint and orchestration logic

##### README for additional insights
- Describes the data points gathered (full name, follower count, private status, hidden email, etc.)
- Usage pattern: Pass Instagram session cookie + username to the CLI

##### Main components & relationships
a. Components
1. CLI Entrypoint (main.py)
2. Core Module (scraper logic, in `OSGIFI/`)
3. HTTP Client (requests or similar library)
4. Data Parser (HTML/JSON parsing sub‐component)
5. Output Formatter (console print, JSON, or file)
6. External Service: Instagram Web Endpoints
b. Relationships & Data Flow
1. User types command → CLI Entrypoint
2. CLI Entrypoint calls Core Module with parameters (username, sessionid)
3. Core Module uses HTTP Client to send request (with session cookie) to Instagram
4. Instagram responds with HTML/JSON → HTTP Client returns raw data
5. Core Module passes raw data to Data Parser → extracts required fields
6. Parsed data goes to Output Formatter → displays structured results to user
c. Architectural patterns & principles
- Layered/Modular design: clear separation between CLI, networking, parsing, and presentation
- Single Responsibility: each module does one thing (e.g., scraping vs. parsing)
- Extensibility point: new data‐extractor functions can be dropped into the parser
d. Key technologies/frameworks
- Python 3.x
- `requests` (or built-in `urllib`) for HTTP calls
- `argparse` for CLI parsing
- `BeautifulSoup` or `json` library for parsing (if used)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Documentation"
        License["LICENSE"]:::docs
        README["README.md"]:::docs
        SetUp["SetUp.py"]:::docs
    end

    subgraph "OSGIFI Python Package"
        Init["__init__.py"]:::package
        subgraph "Core Components"
            CLI["CLI Entrypoint"]:::internal
            Core["Core Scraper Module"]:::internal
            HTTP["HTTP Client"]:::internal
            Parser["Data Parser"]:::internal
            Output["Output Formatter"]:::internal
        end
    end

    User["User"]:::external
    Instagram["Instagram Web API"]:::external

    User -->|"runs OSGIFI -u username -s sessionid"| CLI
    CLI -->|"username, sessionid"| Core
    Core -->|"HTTPS request (session cookie)"| HTTP
    HTTP -->|"HTTPS request"| Instagram
    Instagram -->|"HTML/JSON response"| HTTP
    HTTP -->|"raw data"| Parser
    Parser -->|"structured data"| Output
    Output -->|"display output"| User

    click CLI "https://github.com/okr3vl/osgifi/blob/main/OSGIFI/main.py"
    click Core "https://github.com/okr3vl/osgifi/blob/main/OSGIFI/main.py"
    click HTTP "https://github.com/okr3vl/osgifi/blob/main/OSGIFI/main.py"
    click Parser "https://github.com/okr3vl/osgifi/blob/main/OSGIFI/main.py"
    click Output "https://github.com/okr3vl/osgifi/blob/main/OSGIFI/main.py"
    click Init "https://github.com/okr3vl/osgifi/blob/main/OSGIFI/__init__.py"
    click SetUp "https://github.com/okr3vl/osgifi/blob/main/SetUp.py"
    click README "https://github.com/okr3vl/osgifi/blob/main/README.md"
    click License "https://github.com/okr3vl/osgifi/tree/main/LICENSE"

    classDef internal fill:#AED6F1,stroke:#1B4F72,color:#1B2631
    classDef external fill:#A9DFBF,stroke:#145A32,color:#1B2631
    classDef docs fill:#D5D8DC,stroke:#566573,color:#1B2631
    classDef package fill:#F9E79F,stroke:#9C640C,color:#1B2631
```
