From: Priya Nair, Operations, Fernhill Garden Supply
"Our web shop drops a CSV of new orders into inbox/ every evening, and someone copies them into the warehouse system by hand the next morning. Can you write the tool that does it overnight?
It should only pick up files it hasn't done before (processed.txt lists them), skip rows with a bad email or quantity and tell me which, send the rest to the warehouse API in batches, and leave a summary I can read in the morning. The batch size is set per server in SYNC_BATCH_SIZE, and the token is in FERNHILL_TOKEN. The warehouse API sometimes answers 503 when it's busy."
Done looks like: every batch sent once, processed.txt updated, run-summary.json written, and an exit code the scheduler can act on.
This project puts the whole unit together in one tool, built the way you'd build a sync.py for a real team: options first, then the files, validation, batches, the API calls, the manifest, a summary and the exit code.
The warehouse API is a test server running in your browser, behind the same requests stand-in as the API lesson. It checks the token, stores each batch under its idempotency key, and answers 503 once to see whether your tool retries. env stands in for the server's environment variables.
Your variables carry from step to step. If a later step depends on a name from an earlier one, run the earlier step first, or use Show answer to catch up.
Out: [['FG-1', 'FG-2', 'FG-3', 'FG-4'], ['FG-5', 'FG-6']]. Stepping the start by the batch size keeps the shorter last batch.