# m00nlygreat/renamer architecture

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

- Interactive diagram: https://gitdiagram.com/m00nlygreat/renamer
- Repository: https://github.com/m00nlygreat/renamer

## Overview

##### Project type and purpose
- This is a command-line, open-source utility written in Python (packaged via PyInstaller) that performs bulk file and folder renaming, moving, or deletion based on instructions provided in an Excel spreadsheet.

##### File structure
- Top level:
- makelist.py – CLI script that scans a target directory (and subdirectories) and exports all file/folder metadata into an Excel file (`renamer.xlsx`).
- renamer.py – CLI script that reads an Excel file (default `renamer.xlsx` or user-supplied) and performs actions (rename, move, delete) on files/folders accordingly.
- README.md, LICENSE, .gitignore – project docs/config.
- No subdirectories or services—this is a simple, monolithic CLI tool.

##### README for additional insights
- Workflow:
1. Run `makelist.exe` (or `python makelist.py`) → generates `renamer.xlsx`.
2. User edits the Excel file.
3. Run `renamer.exe` (or `python renamer.py`) → applies changes to filesystem.
4. Optionally use `renamer -u` to reverse the last changes (where possible).
- Key behaviors: create missing target directories, delete when both name & path are blank, ignore invalid rows.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User
    User["User (Excel Editor)"]:::user

    %% Generation Phase
    subgraph "Generation Phase"
        direction TB
        MLCLI["makelist CLI"]:::pythonModule
        Scanner["File System Scanner"]:::pythonModule
        ExcelIO_Gen["Excel I/O Engine"]:::pythonModule
        ExcelFile["renamer.xlsx"]:::excelCylinder
    end

    %% Execution Phase
    subgraph "Execution Phase"
        direction TB
        RCLI["renamer CLI"]:::pythonModule
        ExcelIO_Exec["Excel I/O Engine"]:::pythonModule
        OpEngine["File Operation Engine"]:::pythonModule
        OSFS["Operating System File System"]:::osFS
    end

    %% Documentation
    subgraph "Documentation & Config"
        direction TB
        README["README.md"]:::docs
        LICENSE["LICENSE"]:::docs
        GITIGNORE[".gitignore"]:::docs
    end

    %% Connections
    User -->|opens file| ExcelFile
    MLCLI -->|scans directories| Scanner
    Scanner -->|metadata| ExcelIO_Gen
    ExcelIO_Gen -->|writes| ExcelFile
    ExcelFile -->|edited by| User
    User -->|invokes| RCLI
    RCLI -->|reads| ExcelIO_Exec
    ExcelIO_Exec -->|instructions| OpEngine
    OpEngine -->|executes| OSFS

    %% Click Events
    click MLCLI "https://github.com/m00nlygreat/renamer/blob/main/makelist.py"
    click Scanner "https://github.com/m00nlygreat/renamer/blob/main/makelist.py"
    click ExcelIO_Gen "https://github.com/m00nlygreat/renamer/blob/main/makelist.py"
    click RCLI "https://github.com/m00nlygreat/renamer/blob/main/renamer.py"
    click ExcelIO_Exec "https://github.com/m00nlygreat/renamer/blob/main/renamer.py"
    click OpEngine "https://github.com/m00nlygreat/renamer/blob/main/renamer.py"
    click README "https://github.com/m00nlygreat/renamer/blob/main/README.md"
    click LICENSE "https://github.com/m00nlygreat/renamer/tree/main/LICENSE"
    click GITIGNORE "https://github.com/m00nlygreat/renamer/blob/main/.gitignore"

    %% Styles
    classDef pythonModule fill:#cce5ff,stroke:#1f78b4,color:#000;
    classDef excelCylinder fill:#d4edda,stroke:#28a745,color:#000,stroke-width:2px;
    classDef osFS fill:#f0f0f0,stroke:#6c757d,color:#000,stroke-dasharray: 5, 5;
    classDef user fill:#fff3cd,stroke:#fd7e14,color:#000,stroke-width:2px;
    classDef docs fill:#e2e3e5,stroke:#6c757d,color:#000;
```
