π« The Pain Point
You have an Excel with 500 product URLs in column A and image URLs in column B. You need to download all images and name them by product name.
π Agentic Solution
A Concurrent Image Downloader that processes Excel data efficiently.
Key Features:
- Concurrent Downloads: Process multiple images simultaneously.
- Smart Naming: Use Excel column for filenames.
- Error Recovery: Retry failed downloads, log errors.
βοΈ Phase 1: Commander (Quick Fix)
For quick downloading.
Prompt:
βI have an Excel
products.xlsxwith columns βProduct_Nameβ and βImage_URLβ. Write a Python script using requests to:
- Download: Each image from URL.
- Naming: Use Product_Name as filename.
- Concurrent: Use threading for 5 simultaneous downloads.
- Output: Save to
images/folder.Print progress. Retry failed downloads once. Log failures to
errors.csv.β
Result: All product images organized by name.
ποΈ Phase 2: Architect (Permanent Tool)
For Content Managers.
Engineering Prompt:
**Role:** Python GUI Developer (PyQt6 Specialist)
**Task:** Create "Excel Image Downloader" Desktop App
**Objective:** A high-speed batch downloader that fetches images from URLs listed in spreadsheets.
**Tech Stack:**
* Language: Python 3.10+
* GUI Library: PyQt6 (Cross-platform)
* Network: aiohttp (async)
* Packaging: PyInstaller
**Functional Requirements:**
1. **UI Layout (PyQt6):**
* **Source:** Excel File Input.
* **Mapping:** Dropdowns for "URL Column" and "Filename Column".
* **Output:** Destination Folder.
* **Settings:** Slider for "Concurrency Level" (1-20 threads).
2. **Core Logic:**
* Read Excel with Pandas.
* Async download loop with `aiohttp`.
* Sanitize filenames from column data.
* **Threading:** Async event loop running in a background thread.
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
- Threading/Async: Downloading one by one is slow. Concurrent processing can be 5-10x faster.
π οΈ Instructions
- Copy Prompt β Run.