# eunchuldev/dcinside-python3-api architecture

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

- Interactive diagram: https://gitdiagram.com/eunchuldev/dcinside-python3-api
- Repository: https://github.com/eunchuldev/dcinside-python3-api

## Overview

##### Project type and purpose
- This is an open-source Python3 asynchronous client library (“dcinside-python3-api”) that wraps DCInside’s web interface.
- Its purpose is to let users crawl boards, fetch documents, comments, images, and post or remove content programmatically using asyncio, aiohttp, and lxml.

##### File structure
- Top-level files:
- dc_api.py        ← the entire runtime logic lives here
- setup.py         ← packaging entry point for PyPI
- requirements.txt ← lists aiohttp, lxml
- README.md, LICENSE, .gitignore, .github/workflows/publish_pypi.yml
- No separate “src” or “lib” folders: the library is a single module.
- No microservices or frontend; it’s purely a client-side library.

##### README for insights
- Shows asynchronous usage patterns, available API calls, and data model properties (Index, Document, Comment, Image).
- Mentions dependencies (aiohttp for HTTP, lxml for parsing).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    ClientApp["Client Application"]:::client

    %% Library Components
    subgraph "dc_api Library"
        APIFacade["API Façade\n(class API)"]:::library
        HTTPLayer["HTTP Layer\n(aiohttp session mgr)"]:::library
        HTMLParser["HTML Parser\n(lxml parsing)"]:::library
        DataModels["Data Models\n(Index, Document, Comment, Image)"]:::library
        AsyncManager["Async Manager\n(async context, tasks)"]:::library
        Downloader["Downloader\n(image fetch & file I/O)"]:::library
    end

    %% External Systems
    DCInsideService(("DCInside Service\n(HTTP endpoints)")):::external
    LocalFS(("Local File System")):::external

    %% Documentation & CI
    packaging["Packaging Entry Point\n(setup.py)"]:::docs
    dependencies["Dependency Declarations\n(requirements.txt)"]:::docs
    docsExamples["Project Docs & Examples\n(README.md)"]:::docs
    ciWorkflow["CI/CD Workflow\n(publish_pypi.yml)"]:::docs

    %% Dependencies and Relationships
    ClientApp -->|"calls methods"| APIFacade
    APIFacade -->|"uses"| HTTPLayer
    APIFacade -->|"manages context via"| AsyncManager
    HTTPLayer -->|"sends HTTP"| DCInsideService
    DCInsideService -->|"HTML response"| HTTPLayer
    HTTPLayer -->|"raw HTML"| HTMLParser
    HTMLParser -->|"parsed objects"| DataModels
    DataModels -->|"image.download() calls"| Downloader
    Downloader -->|"writes images"| LocalFS
    HTTPLayer -->|"async I/O under"| AsyncManager
    Downloader -->|"uses async via"| AsyncManager

    %% Click Events
    click APIFacade "https://github.com/eunchuldev/dcinside-python3-api/blob/master/dc_api.py"
    click HTTPLayer "https://github.com/eunchuldev/dcinside-python3-api/blob/master/dc_api.py"
    click HTMLParser "https://github.com/eunchuldev/dcinside-python3-api/blob/master/dc_api.py"
    click DataModels "https://github.com/eunchuldev/dcinside-python3-api/blob/master/dc_api.py"
    click AsyncManager "https://github.com/eunchuldev/dcinside-python3-api/blob/master/dc_api.py"
    click Downloader "https://github.com/eunchuldev/dcinside-python3-api/blob/master/dc_api.py"
    click packaging "https://github.com/eunchuldev/dcinside-python3-api/blob/master/setup.py"
    click dependencies "https://github.com/eunchuldev/dcinside-python3-api/blob/master/requirements.txt"
    click docsExamples "https://github.com/eunchuldev/dcinside-python3-api/blob/master/README.md"
    click ciWorkflow "https://github.com/eunchuldev/dcinside-python3-api/blob/master/.github/workflows/publish_pypi.yml"

    %% Styles
    classDef library fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef client fill:#90EE90,stroke:#333,stroke-width:1px
    classDef external fill:#FFA500,stroke:#333,stroke-width:1px
    classDef docs fill:#D3D3D3,stroke:#333,stroke-width:1px
```
