Stack overview#

Every page here stands on its own. Take the one that answers your question and ignore the rest; nothing assumes you have read anything else.

Each page follows the same shape: why the technology is here, the idea underneath it, how this project actually uses it, the sharp edges worth knowing, and verified links for going deeper. Everything described is grounded in code that exists in this repository. Where the implementation has limits, the page says so.

The stack is deliberately small. Every dependency below is one a user has to install and trust, so each one has to earn its place.

Language and distribution#

Page

What it covers

Python

The language idioms this codebase uses: the src layout, type hints and what they do not guarantee at runtime, dataclasses, enums, and async.

Packaging and distribution

How the project is built and shipped: hatchling, PEP 621 metadata, the tdw console script, extras, and publishing to PyPI.

Reading the database#

Page

What it covers

SQLAlchemy

Schema reflection, the Inspector, connection pooling, foreign keys as a dependency graph, and the DB-API driver layer underneath.

pandas

The DataFrame, what it is used for here, and whether a dependency that heavy earns its place in a command-line tool.

Generating the code#

Page

What it covers

Faker

Synthetic values, seeded determinism, and the two distinct roles Faker plays: one at generation time, one inside the generated code.

Jinja2

A web templating engine pressed into generating Python source, where indentation is semantic and autoescaping would do harm.

The interfaces#

Page

What it covers

Rich

Terminal rendering for the CLI, which is the primary interface: tables, panels, progress, and how output degrades when piped.

FastAPI

The optional HTTP interface: lifespan, routers, OpenAPI generated from type hints, and how much of it is actually implemented.

Uvicorn

The ASGI server underneath FastAPI, the event loop, and why a framework is not a server.

Pydantic

Runtime enforcement of type hints at the API boundary, and where that guarantee stops.

Configuration and IO#

Page

What it covers

PyYAML

Configuration files, the trust boundary of a deserialiser, and why safe_load is not optional.

aiofiles

Asynchronous file IO, and the widely misunderstood fact that file IO is not natively asynchronous on most operating systems.

Testing#

Page

What it covers

pytest

Fixtures as dependency injection, testing async code, and the particular problem of testing a program that writes programs.

What is not here#

Earlier generations of this tool carried Redis, Docker, and a heavier runtime stack. This generation dropped them. A schema-adaptive generator that emits code does not need a caching layer or a message broker to do its job. The short stack is a design choice, not an omission.