didactic

A typed-data library for Python that uses panproto as its substrate. Authoring is class-based and looks like Pydantic. Underneath, every Model corresponds to a panproto Theory, every value to a panproto Schema, and every transformation between Models to a panproto Lens. The package adds the operations that fall out of that substrate: structural fingerprints, schema migrations as registered lenses, schema diffs, breaking-change classification, multi-format code generation, and a wrapper over panproto's filesystem-backed schema repository.

import didactic.api as dx


class User(dx.Model):
    """A user record."""

    id: str
    email: str = dx.field(description="primary contact")
    nickname: str = ""


u = User(id="u1", email="ada@example.org")
print(u.model_dump_json())
# {"id": "u1", "email": "ada@example.org", "nickname": ""}

Where to start

The documentation follows the Diátaxis structure:

Sibling distributions

didactic ships as a namespace package. Three sibling distributions contribute submodules under didactic.<name>:

Install only what you need:

pip install didactic                # core only
pip install didactic-pydantic       # adds didactic.pydantic
pip install didactic-settings       # adds didactic.settings
pip install didactic-fastapi        # adds didactic.fastapi

Project status

didactic is pre-1.0. The public API is the surface documented here. The internal panproto encoding may change between minor releases; the structural fingerprint and the migration registry format are stable across such changes (see Concepts > Fingerprints).