01 · Validate a CSV feed
Normalize dates and integer cents, detect conflicting IDs, and return a report before writing a database.
Continue from Part I
Move beyond first scripts. Validate a CSV feed, store it safely in SQLite, and serve a JSON summary from a local Python app.

12 chapters
12 chapters
Separate raw input, validated state and presentation. Use exact types, stable identity, units and explicit behavior for missing values.
Pages 5–77 · 8 labsKeep business rules separate from files, clocks and I/O. Design a narrow callable or protocol, then substitute a fixture at the same boundary.
Pages 78–150 · 8 labsChoose between materialized results and streaming. Track consumption, memory bounds, ordering and the behavior at end of input.
Pages 151–223 · 8 labsTreat each file format as a contract. Decode shape and data separately, stage replacements, and keep scratch files under an explicit root.
Pages 224–296 · 8 labsWrite fixtures that isolate the boundary. Test failure types and recovery behavior, and keep at least one integration case per workflow.
Pages 337–409 · 8 labsMove mutable state into SQLite. Use parameters, constraints, explicit transactions, deterministic queries and reviewed schema versions.
Pages 410–482 · 8 labsModel HTTP as a boundary with paths, methods, status codes and encoded bodies. Use fixtures for transport decisions and loopback for a controlled integration.
Pages 483–555 · 8 labsBound work by queue capacity, worker count and deadline. Keep stable keys when completion order differs from submission order.
Pages 556–628 · 8 labsDesign tools a terminal or scheduler can use. Separate planning from writes, parse argv explicitly, and give stdout, stderr and exit status distinct meanings.
Pages 669–741 · 8 labsCollect observations that can inform a fix. Use logs for stage and reason, profile repeatable workloads, and keep counters tied to their population.
Pages 742–814 · 8 labsOrganize modules and resources for installed use. Maintain existing interfaces, verify artifacts and exercise the entry point from outside the source directory.
Pages 815–887 · 8 labsPlan for malformed input, duplicate events and partial failure. Tie integration checks and release instructions to an exact example.
Pages 888–960 · 8 labsThree connected projects
Normalize dates and integer cents, detect conflicting IDs, and return a report before writing a database.
Use parameterized SQL, schema versions, transactions, rollback, and replay-safe imports.
Return read-only JSON over loopback. Test real HTTP status, headers, and Unicode body bytes.
Look inside
Try a data-contract lab in the free 16-page excerpt. Preview the source pages from each project.

The PDF and ZIP include 96 runnable labs with assertions and recorded output, a project suite with tests, and a curriculum index. Use Python 3.12 or newer.
Open the Gumroad listing · $20USD base price. Applicable tax is calculated at checkout.