# guaguaguaxia/english_pod architecture

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

- Interactive diagram: https://gitdiagram.com/guaguaguaxia/english_pod
- Repository: https://github.com/guaguaguaxia/english_pod

## Overview

##### Main Components
- Input Loader – This module (within main.py) scans the source directory (in this case, “pdf”) for media files (or audio inputs if they were available separately) that need processing.
- Transcription/Processing Module – The core logic in main.py that coordinates with OpenAI’s Whisper API. This external integration handles converting the audio content (or content extracted from the PDFs) into textual form.
- Output Writers – Two output pathways: one that formats and saves the transcript as an SRT file (placed in the “srt” directory) and another that saves the complete transcript as a TXT file (in the “txt” directory).

##### Relationships and Data Flow
- Then, indicate the response returned by the Whisper API (“Transcription Data”) back to main.py.
- After processing, display two arrowed outputs: one leading to the “srt” directory (for subtitles) and one to the “txt” directory (for full transcripts).

##### Architectural Patterns and Design Principles
- This project follows a pipeline (or sequential processing) pattern where data flows from input to processing to output.
- Separation of concerns: although all logic is in main.py, conceptually separate file management, API integration, and output formatting.
- Use of an external service (Whisper API) as a dependency – the connection to which should be clearly indicated.

##### Technologies and Frameworks
- OpenAI Whisper API is the core technology facilitating transcription.
- The project is built in Python (main.py) and uses a file-based architecture for managing inputs and outputs.
- Optionally, mention any libraries or modules used for HTTP requests, file I/O, or PDF processing if applicable (even if not explicitly visible, these should be considered in the design).

## Diagram (Mermaid)

```mermaid
graph TD
    A["Input Loader (pdf/)"]:::local
    B["Main Application (main.py)"]:::local
    C["Whisper API"]:::external
    D["SRT Writer (srt/)"]:::local
    E["TXT Writer (txt/)"]:::local

    A -->|"inputFiles"| B
    B -->|"TranscriptionRequest"| C
    C -->|"TranscriptionData"| B
    B -->|"GenerateSRT"| D
    B -->|"GenerateTXT"| E

    click A "https://github.com/guaguaguaxia/english_pod/tree/master/pdf"
    click B "https://github.com/guaguaguaxia/english_pod/blob/master/main.py"
    click D "https://github.com/guaguaguaxia/english_pod/tree/master/srt"
    click E "https://github.com/guaguaguaxia/english_pod/tree/master/txt"

    classDef local fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef external fill:#A9DFBF,stroke:#145A32,stroke-width:2px;
```
