Data and Service Boundaries
Validate external data, persist it transactionally, protect secrets, and build a repeatable import pipeline.
Validation, context managers, and tests.
Validate external service data rigorously, persist complete batches transactionally to avoid partial updates, and handle network failures and rate limits gracefully.
Read in order, or jump to what you need.
Every lesson builds on the one before it. Open any lesson to read the explanation, run the examples, and try the practice challenges.
- 15.01HTTP APIs with urllib4 min
Treat transport, decoding, schema validation, and retries as separate responsibilities.
- 15.02SQLite and Transactions4 min
Persist validated data with parameterized queries, explicit transaction boundaries, and reliable connection cleanup.
- 15.03Security and Secrets4 min
Protect credentials, distinguish cryptographic purposes, and design safer input and logging boundaries.
- 15.04Project: An API Data PipelineProject4 min
Build a fixture-driven catalog import with validation, atomic persistence, idempotency, and acceptance checks.
Ready to move on?
Import the same records twice without duplicates, reject a bad batch of malformed data, and prove that existing database rows remain unchanged after a failed import.
Open the module self-check