How I Automated 50,000 Messy Excel Rows & 2,000 E-Commerce Product Images in 15 Seconds with Python
Description and use
Automated 2,000 product images and 50,000 spreadsheet rows in 15 seconds using Python, Pillow, and openpyxl.
Problem
Manual resizing of thousands of supplier images to marketplace specs and cleaning 50,000+ rows of messy order spreadsheets were time‑consuming tasks.
Outcome
The pipeline reduced image processing from ~14 hours to 14.8 seconds and spreadsheet cleaning from ~6 hours to 8.2 seconds, achieving a 15‑second total runtime for 2,000 images and 50,000 rows.
Workflow
- 1. Load each supplier image and resize to 1000x1000 using LANCZOS, apply UnsharpMask and contrast enhancement, then save as JPEG with quality 95 and optimization.
- 2. Strip EXIF metadata during the save process.
- 3. Read the order spreadsheet with openpyxl, apply regex to standardize phone numbers, and inject live Excel formulas directly into cells.
- 4. Write the cleaned data back to an ERP‑ready .xlsx workbook.
- 5. Measure and compare execution time against manual benchmarks.
Evidence
Resizing thousands of supplier images into exact marketplace specs (1000x1000 square cover, 780px detail width) while stripping duplicate EXIF metadata.
2,000 Product Images (3 sizes + EXIF scrub) ~14 hours Manual Time, 14.8 seconds Python Pipeline Time
50,000 ERP Order Rows + Summary Formulas ~6 hours Manual Time, 8.2 seconds Python Pipeline Time
- Record date: 2026-10-27T08:26:15.412Z