graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
"""User store."""
from dataclasses import dataclass
_USERS = {
1: {"name": "Ada", "email": "[email protected]", "active": True},
2: {"name": "Grace", "email": "[email protected]", "active": True},
3: {"name": "Linus", "email": "[email protected]", "active": False},
}
@dataclass(frozen=True)
class User:
uid: int
name: str
email: str
active: bool
def fetch_user(uid):
"""Return the user record as a dict (with its uid), or None."""
row = _USERS.get(uid)
return dict(row, uid=uid) if row else None
def all_ids():
return sorted(_USERS)