# coding-doctor-omar/reddrix architecture

> Architecture diagram of the GitHub repository coding-doctor-omar/reddrix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/coding-doctor-omar/reddrix
- Repository: https://github.com/coding-doctor-omar/reddrix

## Overview

Reddrix is an async Python Reddit scraper and HTTP client. Users configure a Reddrix instance, select subreddit/profile/post or keyword/domain search, and consume structured post and comment items through an async iterator. The main implementation is concentrated in reddrix/reddrix.py; the README documents capabilities beyond the sampled excerpts, so those stages are represented without assuming their internal call structure. Edges reflect README statements or visible source references; unsampled details are not expanded.

Main entry points: [`reddrix/reddrix.py`](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py) (Reddrix API), [`reddrix/cli.py`](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/cli.py) (Install CLI), [`reddrix/exceptions.py`](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/exceptions.py) (Scraping exceptions), [`reddrix/iwswuf.py`](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/iwswuf.py) (iwswuf helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["User API"]
  node_reddrix_api["Reddrix API<br/>[reddrix.py]"]
end

subgraph group_scraping["Scraping Runtime"]
  node_search_modes["Search modes<br/>[reddrix.py]"]
  node_session_setup["Session setup<br/>[reddrix.py]"]
  node_proxy_rotation["Proxy rotation<br/>[reddrix.py]"]
  node_cookie_retry["Cookie recovery<br/>[reddrix.py]"]
  node_http_fetch["HTTP fetching<br/>[reddrix.py]"]
end

subgraph group_data["Data Extraction"]
  node_post_extract["Post extraction<br/>[reddrix.py]"]
  node_comment_extract["Comment extraction<br/>[reddrix.py]"]
  node_item_queue["Item streaming<br/>[reddrix.py]"]
end

subgraph group_support["Runtime Support"]
  node_cli["Install CLI<br/>[cli.py]"]
  node_exceptions["Scraping exceptions<br/>[exceptions.py]"]
  node_iwswuf["iwswuf helper<br/>[iwswuf.py]"]
end

node_user(("Python user"))
node_reddit{{"Reddit"}}
node_camoufox["Camoufox browser"]
node_camoufox_installer["Camoufox installer"]

node_user -->|"configures"| node_reddrix_api
node_reddrix_api -->|"selects"| node_search_modes
node_search_modes -->|"queries"| node_reddit
node_reddrix_api -->|"starts"| node_session_setup
node_session_setup -.->|"selects proxy"| node_proxy_rotation
node_session_setup -->|"initializes"| node_camoufox
node_session_setup -->|"requests login"| node_reddit
node_reddrix_api -->|"fetches data"| node_http_fetch
node_http_fetch -->|"requests pages"| node_reddit
node_http_fetch -->|"fetches via browser"| node_camoufox
node_http_fetch -->|"retries failures"| node_cookie_retry
node_cookie_retry -->|"raises"| node_exceptions
node_http_fetch -.->|"returns data"| node_post_extract
node_post_extract -->|"extracts threads"| node_comment_extract
node_comment_extract -->|"enqueues items"| node_item_queue
node_reddrix_api -->|"streams items"| node_item_queue
node_user -->|"runs install"| node_cli
node_cli -->|"installs binary"| node_camoufox_installer
node_reddrix_api -->|"imports helper"| node_iwswuf

click node_reddrix_api "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_search_modes "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_session_setup "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_proxy_rotation "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_cookie_retry "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_http_fetch "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_post_extract "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_comment_extract "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_item_queue "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py"
click node_cli "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/cli.py"
click node_exceptions "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/exceptions.py"
click node_iwswuf "https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/iwswuf.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_reddrix_api,node_user,node_camoufox toneBlue
class node_search_modes,node_session_setup,node_proxy_rotation,node_cookie_retry,node_http_fetch toneAmber
class node_post_extract,node_comment_extract,node_item_queue toneMint
class node_cli,node_exceptions,node_iwswuf toneRose
class node_reddit,node_camoufox_installer toneIndigo
```

## Components

### User API

- [Reddrix API](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`

### Scraping Runtime

- [Search modes](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`
- [Session setup](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`
- [Proxy rotation](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`
- [Cookie recovery](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`
- [HTTP fetching](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`

### Data Extraction

- [Post extraction](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`
- [Comment extraction](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`
- [Item streaming](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/reddrix.py): `reddrix/reddrix.py`

### Runtime Support

- [Install CLI](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/cli.py): `reddrix/cli.py`
- [Scraping exceptions](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/exceptions.py): `reddrix/exceptions.py`
- [iwswuf helper](https://github.com/coding-doctor-omar/reddrix/blob/main/reddrix/iwswuf.py): `reddrix/iwswuf.py`

### Other components

- **Python user**
- **Reddit**
- **Camoufox browser**
- **Camoufox installer**

## Connections

- Python user → Reddrix API: configures (evidence: `README.md`)
- Reddrix API → Search modes: selects (evidence: `README.md`)
- Search modes → Reddit: queries (evidence: `README.md`)
- Reddrix API → Session setup: starts (evidence: `README.md`)
- Session setup → Proxy rotation: selects proxy (evidence: `reddrix/reddrix.py`)
- Session setup → Camoufox browser: initializes (evidence: `reddrix/reddrix.py`)
- Session setup → Reddit: requests login (evidence: `reddrix/reddrix.py`)
- Reddrix API → HTTP fetching: fetches data (evidence: `README.md`)
- HTTP fetching → Reddit: requests pages (evidence: `reddrix/reddrix.py`)
- HTTP fetching → Camoufox browser: fetches via browser (evidence: `reddrix/reddrix.py`)
- HTTP fetching → Cookie recovery: retries failures (evidence: `reddrix/reddrix.py`)
- Cookie recovery → Scraping exceptions: raises (evidence: `reddrix/reddrix.py`)
- HTTP fetching → Post extraction: returns data (evidence: `reddrix/reddrix.py`)
- Post extraction → Comment extraction: extracts threads (evidence: `reddrix/reddrix.py`)
- Comment extraction → Item streaming: enqueues items (evidence: `reddrix/reddrix.py`)
- Reddrix API → Item streaming: streams items (evidence: `README.md`)
- Python user → Install CLI: runs install (evidence: `README.md`)
- Install CLI → Camoufox installer: installs binary (evidence: `reddrix/cli.py`)
- Reddrix API → iwswuf helper: imports helper (evidence: `reddrix/reddrix.py`)
