Continue from Part I

Python Foundations Workshop II

Move beyond first scripts. Validate a CSV feed, store it safely in SQLite, and serve a JSON summary from a local Python app.

Python Foundations Workshop II cover with terminal windows leading to a ledger
1,000pages
96runnable labs
12chapters
3connected projects

12 chapters

Find a topic

12 chapters

  • 01 Designing data contracts

    Separate raw input, validated state and presentation. Use exact types, stable identity, units and explicit behavior for missing values.

    Pages 5–77 · 8 labs
  • 02 Functions, protocols and modular design

    Keep 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 labs
  • 03 Iterators, streams and memory

    Choose between materialized results and streaming. Track consumption, memory bounds, ordering and the behavior at end of input.

    Pages 151–223 · 8 labs
  • 04 CSV, JSON and safe file updates

    Treat 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 labs
  • 05 Testing and debugging

    Write fixtures that isolate the boundary. Test failure types and recovery behavior, and keep at least one integration case per workflow.

    Pages 337–409 · 8 labs
  • 06 SQLite storage and migrations

    Move mutable state into SQLite. Use parameters, constraints, explicit transactions, deterministic queries and reviewed schema versions.

    Pages 410–482 · 8 labs
  • 07 HTTP boundaries and API clients

    Model 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 labs
  • 08 Concurrency and bounded work

    Bound work by queue capacity, worker count and deadline. Keep stable keys when completion order differs from submission order.

    Pages 556–628 · 8 labs
  • 09 Command-line tools and automation

    Design 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 labs
  • 10 Logs, measurement and performance

    Collect 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 labs
  • 11 Packaging and maintainable releases

    Organize 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 labs
  • 12 Integration, resilience and handoffs

    Plan for malformed input, duplicate events and partial failure. Tie integration checks and release instructions to an exact example.

    Pages 888–960 · 8 labs

Three connected projects

Extend the Expense Tracker

01 · Validate a CSV feed

Normalize dates and integer cents, detect conflicting IDs, and return a report before writing a database.

02 · Write to SQLite

Use parameterized SQL, schema versions, transactions, rollback, and replay-safe imports.

03 · Serve a local summary

Return read-only JSON over loopback. Test real HTTP status, headers, and Unicode body bytes.

Look inside

See an actual workbook page

Try a data-contract lab in the free 16-page excerpt. Preview the source pages from each project.

Open the 16-page sample

Validate a record, page 7

Get the complete workbook

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 · $20

USD base price. Applicable tax is calculated at checkout.