← Back to context

Comment by lacoolj

12 hours ago

Would you mind posting that code to github? I'm curious about the complexity you're describing.

If not, no worries!

Sure, why not: https://github.com/sergiocorreia/overengineered-rand-mcnally

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.

And so on!