Project Description
I need a lightweight Windows desktop utility written in Python that quietly watches a specified “scanner output” folder every few minutes, extracts the first barcode it finds from each new PDF or image, and then uses that value to rename and relocate the file. Typical filenames will follow a pattern such as AI2026000500025.pdf, so the barcode must become the sole filename (plus the .pdf extension).
The application has to recognise all of the following barcode types:
• QR codes
• 1D barcodes (like Code 128)
• 2D barcodes (like Data Matrix)
Key workflow
1. Poll the source folder on the defined interval, detect new items, and ignore anything already processed.
2. Open each PDF or image, read the first valid barcode, and—when multiple documents are scanned together—split the file at each new barcode so every document ends up in its own file.
3. Rename each resulting file with the barcode value and move it to the destination folder. Collisions should trigger a simple increment or timestamp so nothing is overwritten.
Interface
A minimal GUI is enough: fields for source and target folders, a numeric interval selector, a start/stop button, and a small log window or status bar summarising activity. No installation wizard is needed; a single-folder executable built with PyInstaller is perfect.
Deliverables
• Complete, well-commented Python source (preferably using watchdog, PyPDF2/PyMuPDF, Pillow, and pyzbar or an equivalent reader).
• Standalone Windows build (.exe).
• Brief read-me explaining setup, configuration, and how to extend the barcode patterns if needed.
I will test by dropping mixed multi-page scans into the watch folder and verifying that each document is split, renamed exactly to its barcode, and placed in the destination directory within the expected interval.