The original script was mostly very simple python:
1. Download some public PDFs.
2. Have a double for-loop (over PDFs and pages within PDF),
3. Use a library to call gemini-3.7-flash and ask it to run some OCR
4. Save JSON outputs, save a csv with results, validate with some Stata code
New code folder was 189 files. Just the PDF download folder is now 7 files involving an adapter, a source manager, an acquisition manager, etc.
Every instance of saving a file involves saving a temporary copy and then moving it, so e.g. I lose power, we minimize the risk of corrupted files.
If not, no worries!