Skip to content
CAI
Software that uses CAICheck a score

iktakahiro/dddpy

64.1

Adequate · 21 September 2026

1.4k

lines of production code

Python

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Python-based web application that implements Domain-Driven Design and Onion Architecture principles to manage a Todo list. It exposes a RESTful API for creating, reading, updating, and deleting todos, with a clear separation between domain logic, use cases, and infrastructure. The application uses FastAPI for the presentation layer, SQLAlchemy with SQLite for data persistence, and a centralized dependency injection system to wire components together.

How it got here

2021 — Initial project scaffolding and architecture setup

9 changes.

This period marks the initial release and structural setup of a Python application based on Domain-Driven Design and Onion Architecture. The work involved establishing the core domain models, infrastructure layers for SQLite persistence, and the presentation layer using FastAPI and Pydantic. Additionally, the project configuration was modernized with updated dependencies and tooling.

2025 — Todo feature implementation

4 changes.

This period focused on implementing the Todo feature across the entire application stack, establishing the domain model, use cases, and SQLite persistence layer. The work introduced a complete CRUD interface for managing todos, supported by a centralized dependency injection system to wire the components together.

Features

Initial release of the Python DDD & Onion-Architecture example

The repository is initialized with a complete FastAPI application demonstrating Domain-Driven Design and Onion Architecture. This includes the project structure with domain entities, value objects, and repository interfaces, alongside infrastructure for SQLite persistence and dependency injection. The setup utilizes uv for dependency management, Ruff for linting and formatting, and Pyrefly for type checking. The application bootstraps a FastAPI app with a managed database lifespan, providing a RESTful API for managing todos.

(repo-wide) · high confidence

Initial release of the dddpy package structure

The dddpy package and its domain subpackage are introduced as empty modules, establishing the initial project layout for domain-driven design in Python.

dddpy, dddpy/domain · high confidence

Introduce Todo API presentation layer with schemas, handlers, and error messages

The presentation layer for the Todo feature has been established, introducing Pydantic schemas (TodoCreateSchema, TodoSchema, TodoUpdateSchema) that define the request and response structures for the API. A new TodoApiRouteHandler registers HTTP endpoints for creating, reading, updating, and completing todos, mapping domain use cases to HTTP responses. Additionally, specific error message schemas (e.g., ErrorMessageTodoNotFound) are provided to standardize error responses.

dddpy/presentation · high confidence

Introduce Todo domain model with lifecycle management

The Todo domain has been established with a structured package containing the Todo entity, value objects (Title, Description, Status, Id), and a repository interface for persistence. The Todo entity supports state transitions (Not Started, In Progress, Completed) and includes an overdue check, while specific exceptions handle invalid state changes.

dddpy/domain/todo · high confidence

Introduce Todo use-case layer with full CRUD operations

The Todo domain now has a dedicated use-case layer that exposes application boundaries for creating, reading (by ID and list), updating, starting, completing, and deleting todos. Each operation is implemented as an independent use case class that depends on a TodoRepository, and the package re-exports all use-case classes and their corresponding factory functions (e.g., new\_create\_todo\usecase) for dependency injection. This change adds the complete set of Todo use cases, each with explicit error handling for missing or invalid states, and ensures the public API is accessible via the todo package's \\init\\_.py.

dddpy/usecase/todo · high confidence

Introduce centralized dependency injection for Todo use cases

A new dependency injection configuration file has been added to wire up the Todo domain. This introduces a FastAPI-based DI setup that provides a managed SQLAlchemy session and injects a TodoRepository into all Todo-related use cases (create, start, complete, update, delete, find by ID, and find all). This centralizes how the application resolves database sessions and repository instances for the Todo feature.

dddpy/infrastructure/di · high confidence

SQLite infrastructure module initialization

The SQLite infrastructure layer is now exposed via a new package structure. The \\_\init\\_.py\ file initializes the module and exposes the \todo\ subpackage. A new \database.py\ file provides SQLAlchemy configuration, including the database URL (\sqlite:///./db/sqlite.db\), engine setup with thread-safety disabled, and a \create\_tables\ function to initialize database tables.

dddpy/infrastructure/sqlite · high confidence

SQLite persistence layer for Todo domain

The application now supports storing and retrieving Todo items using a SQLite database. This change introduces a new infrastructure module that maps domain entities to SQLite rows via SQLAlchemy, providing a concrete repository implementation for saving, finding, and deleting todos. Users benefit from persistent storage of their todo list data, enabling data retention across sessions.

dddpy/infrastructure/sqlite/todo · high confidence

Behavioural changes

Added placeholder for db directory

A .gitkeep file was added to the db directory, ensuring the directory is tracked by version control even when empty.

db · high confidence

Expose the 'todo' use case module

The 'todo' module is now exposed at the top level of the 'usecase' package, allowing users to import it directly from 'dddpy.usecase'.

dddpy/usecase · high confidence

Initialize the infrastructure package with public API exports

The infrastructure package is initialized with a docstring and explicit exports for the 'di' and 'sqlite' modules, making them accessible via the package's public API.

dddpy/infrastructure · medium confidence

Test coverage

Added test coverage for Todo domain and use cases

Added comprehensive tests for the Todo entity, value objects (title, description, status, ID), and all Todo-related use cases (create, find, update, delete, start, complete). The test suite validates entity behavior, value object constraints, and use case interactions with the repository.

tests · high confidence

Dependencies

Upgrade Python 3.13 and modernize project configuration

The project now requires Python 3.13 and upgrades key dependencies including FastAPI to 0.135.3 and SQLAlchemy to 2.0.48. The build system has been updated to use hatchling, and the tooling configuration has been modernized with Ruff for linting and formatting, while pyrefly is introduced as the new type checker replacing mypy.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 61 → 64 (+3.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 99 → 100 (+0.3)
  • Architecture 69 → 69 (+0.0)
  • Maturity 63 → 65 (+2.3)
  • Readiness 46 → 52 (+6.4)
  • Security 93 → 93 (+0.0)
  • Domain Modelling 100 → 100 (+0.0)

Resolved (14)

  • Coverage not included — suite not readable by the collector
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • Duplicated block (15 lines × 2) (dddpy/presentation/api/todo/handlers/todo_api_route_handler.py)
  • Duplicated block (7 lines × 2) (dddpy/infrastructure/sqlite/todo/todo_dto.py)
  • High CVE: [GHSA redacted] (uv.lock)
  • High CVE: [GHSA redacted] (uv.lock)
  • High CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: PYSEC-2026-2132 (uv.lock)
  • No exposed public API
  • Off-boarding risk: anonymized user #1
  • Test reliability not included

New (17)

  • Critical CVE: [GHSA redacted] (uv.lock)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (15 lines × 2) (dddpy/presentation/api/todo/handlers/todo_api_route_handler.py)
  • Duplicated block (7 lines × 2) (dddpy/infrastructure/sqlite/todo/todo_dto.py)
  • High CVE: [GHSA redacted] (uv.lock)
  • High CVE: [GHSA redacted] (uv.lock)
  • High CVE: [GHSA redacted] (uv.lock)
  • Low IaC: WD-DOCKER-0003 (.devcontainer/Dockerfile)
  • Low IaC: WD-DOCKER-0003 (.devcontainer/Dockerfile)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: [GHSA redacted] (uv.lock)
  • Medium CVE: PYSEC-2026-2132 (uv.lock)
  • No dependency advisory monitoring
  • Outdated: fastapi
  • Outdated: sqlalchemy

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

iktakahiro/dddpy was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit f9a2cfe542b7a08e8a2ca224ad38457814f0dc5b — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-fa71c66cabd8.