Lab 15: Capstone — Production Data Service

Objective

Build a production-grade data service combining all Python Advanced techniques: metaclass-driven model registration, async request pipeline with backpressure, numpy/pandas analytics engine, plugin architecture, AES-style encryption via hashlib+secrets, SQLite with window functions, and a CLI interface with argparse.

Background

Production Python services integrate many layers simultaneously. This capstone wires together the techniques from labs 01–14: metaclass registry (lab 01), AST instrumentation (lab 02), memory-efficient generators (lab 03), async pipeline (lab 05), HMAC security (lab 07), SQLite analytics (lab 08), numpy/pandas processing (labs 09–10), and plugin loading (lab 12).

Time

45 minutes

Prerequisites

  • All Python Advanced labs 01–14

Tools

  • Docker: zchencow/innozverse-python:latest


Lab Instructions

The Architecture

Steps 1–8: Full service build and verification

💡 Plugin systems with decorators enable zero-coupling extensibility. The @plugin("name") decorator registers a function into _PLUGINS at import time — the core service never needs to know about specific plugins. New plugins are added by writing a decorated function anywhere in the codebase. This is how Flask registers routes (@app.route), Pytest discovers fixtures, and Click builds CLI commands.

📸 Verified Output:


What You Built

Component
Lab Origin
Lines

ModelMeta registry

Lab 01 (Metaprogramming)

~15

HMAC SecureStore

Lab 07 (Cryptography)

~20

SQLite window functions

Lab 08 (Advanced SQLite)

~15

numpy/pandas analytics

Labs 09–10

~20

Async pipeline

Lab 05 (Advanced Async)

~25

Plugin system

Lab 12 (Plugin Architecture)

~15

Congratulations! 🎉

You've completed all 15 Python Advanced labs. You now have working knowledge of:

  • Metaprogramming — metaclasses, AST, bytecode

  • Memory & Performance — slots, tracemalloc, profiling, numpy vectorisation

  • Concurrency — asyncio, thread/process pools, actor pattern

  • Security — hashlib, HMAC, PBKDF2, secrets

  • Data — SQLite window functions, pandas MultiIndex, ETL pipelines

  • Architecture — plugins, DI containers, middleware chains

Further Reading

Last updated