π« The Pain Point
You have a single Excel file with 12 sheets (one per month). You need to send each monthβs data to a different person as separate files.
π Agentic Solution
A Sheet Splitter that exports each tab as its own file.
Key Features:
- Individual Files: One file per sheet.
- Naming Pattern: Use sheet name as filename.
- Format Options: XLSX or CSV output.
βοΈ Phase 1: Commander (Quick Fix)
For quick splitting.
Prompt:
βI have an Excel file
annual_report.xlsxwith 12 sheets. Write a Python script using Pandas to:
- Split: Each sheet into a separate file.
- Naming: Use sheet name (e.g.,
January.xlsx).- Output: Save to
split_sheets/folder.Print progress. Handle empty sheets (skip with warning).β
Result: 12 separate files ready for distribution.
ποΈ Phase 2: Architect (Permanent Tool)
For Accountants.
Engineering Prompt:
**Role:** Python GUI Developer (PyQt6 Specialist)
**Task:** Create "Sheet Splitter" Desktop App
**Objective:** A simple utility to explode a multi-sheet Workbook into separate Excel/CSV files.
**Tech Stack:**
* Language: Python 3.10+
* GUI Library: PyQt6 (Cross-platform)
* Data Engine: Pandas/Openpyxl
* Packaging: PyInstaller
**Functional Requirements:**
1. **UI Layout (PyQt6):**
* **Input:** Source Excel File Select.
* **Selection:** ListWidget with checkboxes for each detected Sheet Name.
* **Format:** Output format (XLSX keeps format / CSV plain text).
* **Action:** "Split Selected" button.
2. **Core Logic:**
* Load workbook metadata.
* Iterate selected sheets and save individually.
* **Threading:** File writing in background.
3. **Deliverables:**
* `main.py`: Complete source code.
* `requirements.txt`: Dependencies.
* **Build Instructions:**
* Windows: `pyinstaller --onefile --noconsole main.py`
* macOS: `pyinstaller --windowed --noconsole main.py`
π§ Prompt Decoding
- Preserve Formatting: CSV loses formatting; XLSX keeps it.
π οΈ Instructions
- Copy Prompt β Run.