# nichind/moe-parsers architecture

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

- Interactive diagram: https://gitdiagram.com/nichind/moe-parsers
- Repository: https://github.com/nichind/moe-parsers

## Overview

##### Project Type and Purpose
- moe-parsers appears to be a Python library focused on parsing data from multiple anime/media stream providers.
- It’s designed to be modular, with a central “core” that houses shared functionality and “providers” that implement parsing for various external sources (e.g., animego, kodik, shikimori).

##### Key Components from the File Structure
- Core Module:
- Located under moe_parsers/core, this module includes:
▪ adapter.py – Likely serves as an intermediary interface for different provider implementations.
▪ items.py and parser.py – Responsible for the common parsing logic and data representation.
- Providers:
- Located under moe_parsers/providers, these files (animego.py, kodik.py, shikimori.py) provide the specific parsing logic for each external source.
- They probably implement or extend the interfaces defined in the core adapter, thereby following the Adapter or Plugin design pattern.
- Documentation & Build/CI:
- “docs” directory and mkdocs.yml for generating project documentation.
- GitHub workflows in the .github directory for publishing the library and running tests.
- Testing:
- In the tests directory, tests cover functionality, including adapter tests and provider-specific tests (e.g., test_shikimori.py).

a. Main Components:
- Core Module: Represent it as a central component that defines the common parsing logic and adapter interfaces.
- Providers: Represent each provider (animego, kodik, shikimori) as separate components that plug into the core adapter.
- Testing Suite: Indicate a separate but connected component that validates the interactions between core and provider modules.
- CI/CD & Build: Highlight the GitHub Actions workflows which automate tests and publish processes.
- Documentation: Show the documentation toolchain (MkDocs) that is used to generate and manage docs.

b. Relationships and Data Flow:
- From the Core Module, illustrate data flows (via abstraction interfaces) to each of the Provider components.

c. Architectural Patterns and Design Principles:
- Adapter/Plugin Pattern: Emphasize that the core adapter exposes a unified interface while delegating provider-specific parsing logic to distinct modules.
- Separation of Concerns: Note how parsing logic is divided between common operations (core) and provider-specific implementations.
- Modular and Extensible Design: Highlight that to integrate new providers, one can simply add new modules under moe_parsers/providers.

d. Technologies, Frameworks, and Tools:
- Python: The main language used (inferred from .py files, pyproject.toml, and requirements.txt).
- MkDocs: Used for documentation.
- GitHub Actions: For continuous integration (publish and test workflows).
- Testing Framework: Although not explicitly named, tests are likely run using Python unittest or pytest (as seen from tests directory).

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client/Application"]:::client
    Core["Core Module (Adapter/Parser Logic)"]:::core
    Animego["Provider: Animego"]:::provider
    Kodik["Provider: Kodik"]:::provider
    Shikimori["Provider: Shikimori"]:::provider
    Testing["Testing Suite"]:::testing
    CICD["CI/CD (GitHub Actions)"]:::ci
    Docs["Documentation (MkDocs)"]:::docs

    Client -->|"calls"| Core
    Core -->|"delegates"| Animego
    Core -->|"delegates"| Kodik
    Core -->|"delegates"| Shikimori
    Animego -->|"returns"| Core
    Kodik -->|"returns"| Core
    Shikimori -->|"returns"| Core
    Testing -->|"validates"| Core
    Testing -->|"validates"| Animego
    Testing -->|"validates"| Kodik
    Testing -->|"validates"| Shikimori
    CICD -->|"triggers"| Testing
    CICD -->|"publishes"| Docs
    Docs -->|"informs"| Client

    click Core "https://github.com/nichind/moe-parsers/tree/main/moe_parsers/core"
    click Animego "https://github.com/nichind/moe-parsers/blob/main/moe_parsers/providers/animego.py"
    click Kodik "https://github.com/nichind/moe-parsers/blob/main/moe_parsers/providers/kodik.py"
    click Shikimori "https://github.com/nichind/moe-parsers/blob/main/moe_parsers/providers/shikimori.py"
    click Testing "https://github.com/nichind/moe-parsers/tree/main/tests"
    click CICD "https://github.com/nichind/moe-parsers/tree/main/.github/workflows"
    click Docs "https://github.com/nichind/moe-parsers/tree/main/docs"

    classDef client fill:#f9c,stroke:#333,stroke-width:2px;
    classDef core fill:#bbf,stroke:#333,stroke-width:2px;
    classDef provider fill:#bfb,stroke:#333,stroke-width:2px;
    classDef testing fill:#ffb,stroke:#333,stroke-width:2px;
    classDef ci fill:#fdf,stroke:#333,stroke-width:2px;
    classDef docs fill:#cdf,stroke:#333,stroke-width:2px;
```
