# thepycoach/automation architecture

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

- Interactive diagram: https://gitdiagram.com/thepycoach/automation
- Repository: https://github.com/thepycoach/automation

## Overview

##### Project type and purpose
- This is an educational “Automate Your Life with Python” repository: a collection of standalone Python automation scripts and Jupyter notebooks covering many small use cases (table extraction, news scraping, Excel/Word/PDF generation, email/WhatsApp/ChatGPT interactions, file management, etc.).
- It is not a single monolithic product but rather a toolkit of focused modules, each illustrating a particular automation pattern.

##### File structure
- Top‑level directories represent functional groupings:
- “1.Table Extraction” – extract tables from websites and PDFs
- “2.Automate The News” – scrape and automate news‐related workflows
- “3.Excel Report” – generate pivot tables, charts, reports, convert to executables
- “4.WhatsApp” – send WhatsApp messages via pywhatkit
- “ChatGPT” – scripts to send emails and integrate with OpenAI models
- “File Management” – classify and dedupe files
- “Google Form” – submit and read form data, generate fake data
- “PDF” – create basic PDFs, invoices, facturas in Spanish/English
- “Tinder” – tutorials for Tinder API automation
- “Word” – generate Word documents from templates with python‑docx
- “bypass” – 2captcha and Cloudflare bypass examples
- “datasets” – sample Excel data files
- “spanish” – localized Excel automation scripts
- “test‑folder” – dummy file structures for file management demos
- Each directory contains one or more .py or .ipynb scripts and any required assets (HTML templates, CSS, sample data files).

##### README for additional insights
- The README confirms this is course material for “Automate Your Life with Python” (both English and Spanish versions).
- No single “architecture” section, as each script is independent.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        User["User<br/>(CLI / Jupyter)"]:::user
    end

    %% Orchestration Layer: Script Modules
    subgraph "Orchestration Layer"
        direction TB

        subgraph "Table Extraction Module" 
            TE1["Extract CSV & HTML Tables.ipynb"] 
            TE2["Extract Tables from PDFs.py"] 
        end
        TE["1.Table Extraction"]:::module

        subgraph "News Scraping Module"
            NS1["1.news-extract-data.py"]
            NS2["2.news-headless.py"]
            NS3["3.news-automation.py"]
        end
        NS["2.Automate The News"]:::module

        subgraph "Excel Reporting Module"
            ER1["1.make-pivot-table.py"]
            ER2["2.add-charts.py"]
            ER3["3.apply-formulas.py"]
            ER4["4.format-cells.py"]
            ER5["5.pivot-to-report.py"]
            ER6["6.py-to-exe.py"]
        end
        ER["3.Excel Report"]:::module

        subgraph "WhatsApp Messaging Module"
            WA1["0.whatsapp-pywhatkit.py"]
        end
        WA["4.WhatsApp"]:::module

        subgraph "ChatGPT & Email Integration Module"
            CE1["send_email_attachment.py"]
            CE2["send_email_multiple_receivers.py"]
            CE3["send_emails.py"]
            CE4["Excel Automation - Medium.ipynb"]
        end
        CE["ChatGPT"]:::module

        subgraph "File Management Utilities"
            FM1["classify-files.py"]
            FM2["delete-duplicate-files.py"]
        end
        FM["File Managment"]:::module

        subgraph "Google Form Automation Module"
            GF1["automate-form.py"]
            GF2["reading-data.py"]
            GF3["fake-data.py"]
        end
        GF["Google Form"]:::module

        subgraph "PDF Generation Module"
            PDF1["basic-pdf.py"]
            PDF2["factura.py"]
            PDF3["invoice.py"]
        end
        PDFM["PDF"]:::module

        subgraph "Word Document Generation Module"
            WD1["en-word.py"]
            WD2["sp-word.py"]
        end
        WD["Word"]:::module

        subgraph "Tinder API Automation Module"
            TD1["en-tutorial.py"]
            TD2["sp-tutorial.py"]
        end
        TD["Tinder"]:::module

        subgraph "Bypass Utilities Module"
            BP1["bypass-2captcha.py"]
            BP2["bypass-cloudflare.py"]
        end
        BP["bypass"]:::module
    end

    %% Data Storage Layer
    subgraph "Data Storage"
        direction TB
        DS1["datasets"]:::data
        DS2["spanish"]:::data
        DS3["test-folder"]:::data
    end

    %% External Services Layer
    subgraph "External Services"
        direction TB
        Web["Websites<br/>(news, forms)"]:::cloud
        SMTP["Email SMTP/IMAP"]:::cloud
        WhatsAppWeb["WhatsApp Web"]:::cloud
        OpenAI["OpenAI API"]:::cloud
        BypassSvc["2captcha / Cloudflare"]:::cloud
    end

    %% Python Engine
    Python["Python Interpreter<br/>+ Standard Libs"]:::core

    %% Connections
    User -->|invokes| TE
    User -->|invokes| NS
    User -->|invokes| ER
    User -->|invokes| WA
    User -->|invokes| CE
    User -->|invokes| FM
    User -->|invokes| GF
    User -->|invokes| PDFM
    User -->|invokes| WD
    User -->|invokes| TD
    User -->|invokes| BP

    TE -->|executes| Python
    NS -->|executes| Python
    ER -->|executes| Python
    WA -->|executes| Python
    CE -->|executes| Python
    FM -->|executes| Python
    GF -->|executes| Python
    PDFM -->|executes| Python
    WD -->|executes| Python
    TD -->|executes| Python
    BP -->|executes| Python

    %% Data flows
    TE -->|reads/writes| DS1
    NS -->|writes| DS1
    ER -->|reads/writes| DS1
    CE -->|reads/writes| DS1
    FM -->|reads/writes| DS3
    GF -->|reads/writes| DS1
    PDFM -->|reads templates| DS1
    WD -->|reads templates| DS1
    TD -->|reads/writes| DS1
    BP -->|reads/writes| DS1

    %% External API calls
    NS -->|HTTP| Web
    GF -->|HTTP| Web
    CE -->|SMTP/API| SMTP
    WA -->|Web UI| WhatsAppWeb
    CE -->|HTTP| OpenAI
    BP -->|HTTP| BypassSvc

    %% Click Events
    click TE "https://github.com/thepycoach/automation/blob/main/1.Table Extraction"
    click TE1 "https://github.com/thepycoach/automation/blob/main/1.Table Extraction/Extract CSV files and Tables from Websites.ipynb"
    click TE2 "https://github.com/thepycoach/automation/blob/main/1.Table Extraction/Extract Tables from PDFs.py"

    click NS "https://github.com/thepycoach/automation/blob/main/2.Automate The News"
    click NS1 "https://github.com/thepycoach/automation/blob/main/2.Automate The News/1.news-extract-data.py"
    click NS2 "https://github.com/thepycoach/automation/blob/main/2.Automate The News/2.news-headless.py"
    click NS3 "https://github.com/thepycoach/automation/blob/main/2.Automate The News/3.news-automation.py"

    click ER "https://github.com/thepycoach/automation/blob/main/3.Excel Report"
    click ER1 "https://github.com/thepycoach/automation/blob/main/3.Excel Report/1.make-pivot-table.py"
    click ER2 "https://github.com/thepycoach/automation/blob/main/3.Excel Report/2.add-charts.py"
    click ER3 "https://github.com/thepycoach/automation/blob/main/3.Excel Report/3.apply-formulas.py"
    click ER4 "https://github.com/thepycoach/automation/blob/main/3.Excel Report/4.format-cells.py"
    click ER5 "https://github.com/thepycoach/automation/blob/main/3.Excel Report/5.pivot-to-report.py"
    click ER6 "https://github.com/thepycoach/automation/blob/main/3.Excel Report/6.py-to-exe.py"

    click WA "https://github.com/thepycoach/automation/blob/main/4.WhatsApp"
    click WA1 "https://github.com/thepycoach/automation/blob/main/4.WhatsApp/0.whatsapp-pywhatkit.py"

    click CE "https://github.com/thepycoach/automation/tree/main/ChatGPT"
    click CE1 "https://github.com/thepycoach/automation/blob/main/ChatGPT/send_email_attachment.py"
    click CE2 "https://github.com/thepycoach/automation/blob/main/ChatGPT/send_email_multiple_receivers.py"
    click CE3 "https://github.com/thepycoach/automation/blob/main/ChatGPT/send_emails.py"
    click CE4 "https://github.com/thepycoach/automation/blob/main/ChatGPT/Excel Automation - Medium.ipynb"

    click FM "https://github.com/thepycoach/automation/tree/main/File Managment"
    click FM1 "https://github.com/thepycoach/automation/blob/main/File Managment/classify-files.py"
    click FM2 "https://github.com/thepycoach/automation/blob/main/File Managment/delete-duplicate-files.py"

    click GF "https://github.com/thepycoach/automation/tree/main/Google Form"
    click GF1 "https://github.com/thepycoach/automation/blob/main/Google Form/automate-form.py"
    click GF2 "https://github.com/thepycoach/automation/blob/main/Google Form/reading-data.py"
    click GF3 "https://github.com/thepycoach/automation/blob/main/Google Form/fake-data.py"

    click PDFM "https://github.com/thepycoach/automation/tree/main/PDF"
    click PDF1 "https://github.com/thepycoach/automation/blob/main/PDF/1.basic-pdf-spanish/pdf-basico.py"
    click PDF2 "https://github.com/thepycoach/automation/blob/main/PDF/2.factura-pdf-spanish/factura.py"
    click PDF3 "https://github.com/thepycoach/automation/blob/main/PDF/2.invoice-pdf/invoice.py"

    click WD "https://github.com/thepycoach/automation/tree/main/Word"
    click WD1 "https://github.com/thepycoach/automation/blob/main/Word/en-word.py"
    click WD2 "https://github.com/thepycoach/automation/blob/main/Word/sp-word.py"

    click TD "https://github.com/thepycoach/automation/tree/main/Tinder"
    click TD1 "https://github.com/thepycoach/automation/blob/main/Tinder/en-tutorial.py"
    click TD2 "https://github.com/thepycoach/automation/blob/main/Tinder/sp-tutorial.py"

    click BP "https://github.com/thepycoach/automation/tree/main/bypass"
    click BP1 "https://github.com/thepycoach/automation/blob/main/bypass/bypass-2captcha.py"
    click BP2 "https://github.com/thepycoach/automation/blob/main/bypass/bypass-cloudflare.py"

    click DS1 "https://github.com/thepycoach/automation/tree/main/datasets"
    click DS2 "https://github.com/thepycoach/automation/tree/main/spanish"
    click DS3 "https://github.com/thepycoach/automation/tree/main/test-folder"

    classDef user fill:#f9f,stroke:#333,stroke-width:1px
    classDef module fill:#ccf,stroke:#333,stroke-width:1px
    classDef core fill:#cfc,stroke:#333,stroke-width:1px
    classDef data fill:#fcf,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
    classDef cloud fill:#cff,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2
```
