Batch processing

Running one operation across a whole folder without babysitting it.

A folder loop that stops at the first bad file, against one that records it and carries on. one bad file in two hundredstops at file 7 — four hours inand the run is worth nothingrecords file 7, finishes the other 199The retry pass afterwards runs over one file, not two hundred

A batch job is a loop with opinions. Find the files, do one thing to each, write the output somewhere traceable — and survive the one file in two hundred that is corrupt, empty, in a different CRS or has a column the others do not.

That survival is the whole subject. A loop with no try/except stops at file seven, four hours in, and the run is worth nothing. A loop that records the failure and carries on finishes the other 199 and leaves you a one-file retry. From there the questions are about discovery, mirrored output paths, deciding on the unit of work, and making the run resumable so a crash costs minutes rather than the afternoon.

The pages below cover the pattern, the variations on it — nested folders, mixed formats, several outputs per input — and the specific ways a folder of real data breaks it.

Learning paths run through this topic too — see the end of this page.

🧭 Start with the concepts

The ideas the how-to guides below assume you already have.

⚙️ Then do the task

Step-by-step walkthroughs with code you can copy and adapt.

Show every how-to guide in this topic

🔧 When it breaks

The errors this topic produces, with the cause explained rather than just the command.

Show every fix in this topic

Related topics

Subjects that keep coming up alongside this one, most overlap first.

Keep browsing

Batch processing sits in Production. Every topic on the site is listed on the topics index.