# jldevezas/survivor-network-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/jldevezas/survivor-network-analysis
- Repository: https://github.com/jldevezas/survivor-network-analysis

## Overview

##### Main Components
- Input Module – This is the command-line interface where the user supplies the URL for the Survivor Wiki page and an optional episode number.
- Data Extraction Component – Although not refactored into multiple files, conceptually this part handles the scraping/extraction of voting data from the provided URL.
- CON Score Analyzer – The core logic that builds the voting network and calculates the CON score for each contestant based on the extracted data.
- Output/Result Component – The section that formats and prints (or returns) the ranking of contestants based on their scores to the console.
- Setup and Dependencies – Although not shown as separate modules, acknowledge that the virtual environment and package installation (via requirements.txt) set up the runtime for the script.

##### Relationships and Data Flow
- The process begins with user input through a command-line interface (e.g., by executing compute_con_score.py with parameters).
- That input is passed to the Data Extraction Component, which fetches and parses the Survivor Wiki page to obtain the voting network data.
- The parsed data then feeds into the CON Score Analyzer, where the script computes the ranking scores.
- Once computed, the output component displays the result to the user.

##### Architectural / Design Elements
- Although there are no external services, you might illustrate how the system interacts with an external “web source” (the Fandom Wiki) to emphasize external dependency.

##### Relevant Technologies
- Python (as the application language).
- (Any libraries mentioned in requirements.txt; even if not explicitly listed in the file tree you have, you might assume common libraries for HTTP requests or parsing HTML such as requests or BeautifulSoup are used.)
- Command-line interface – highlighting that the user interacts with the system via the terminal.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Nodes
    Setup["Setup & Dependencies"] 
    CLI["Command-Line Interface (CLI)"]
    DE["Data Extraction Component"]
    AN["CON Score Analyzer"]
    OUT["Output/Result Component"]
    Wiki["Survivor Wiki Page (External)"]

    %% Data Processing Pipeline
    CLI -->|"sends URL/episode"| DE
    DE -->|"parsed data"| AN
    AN -->|"ranking"| OUT

    %% External Dependency
    Wiki ---|"scrapes HTML"| DE

    %% Setup Dependency arrows to each component
    Setup ---|requires| CLI
    Setup ---|requires| DE
    Setup ---|requires| AN
    Setup ---|requires| OUT

    %% Click Events
    click CLI "https://github.com/jldevezas/survivor-network-analysis/blob/master/compute_con_score.py"
    click DE "https://github.com/jldevezas/survivor-network-analysis/blob/master/compute_con_score.py"
    click AN "https://github.com/jldevezas/survivor-network-analysis/blob/master/compute_con_score.py"
    click OUT "https://github.com/jldevezas/survivor-network-analysis/blob/master/compute_con_score.py"
    click Setup "https://github.com/jldevezas/survivor-network-analysis/blob/master/requirements.txt"

    %% Styles
    classDef setup fill:#e1bee7,stroke:#8e24aa,stroke-width:2px;
    classDef cli fill:#c8e6c9,stroke:#43a047,stroke-width:2px;
    classDef data fill:#ffecb3,stroke:#ffb300,stroke-width:2px;
    classDef analyzer fill:#ffe0b2,stroke:#fb8c00,stroke-width:2px;
    classDef output fill:#d1c4e9,stroke:#5e35b1,stroke-width:2px;
    classDef external fill:#ffcdd2,stroke:#e53935,stroke-width:2px;

    class Setup setup;
    class CLI cli;
    class DE data;
    class AN analyzer;
    class OUT output;
    class Wiki external;
```
