Skip to main content

scaffold-ca-python

PyPI version Python License: MIT

What is this?

scaffold-ca-python is a CLI tool that scaffolds production-ready Python projects that follow Clean Architecture. It helps teams start faster by generating the project structure, modules, adapters, entry points, helpers, and pipeline files needed to keep architectural boundaries explicit. It is designed for developers who want repeatable code generation instead of hand-creating the same project pieces over and over.

Installation

Python 3.13 or newer is required.

Install with pip:

pip install scaffold-ca-python

Install with uv:

uv add scaffold-ca-python

You could also use uvx:

uvx scaffold-ca-python [command]

Use --help to see all available command.

Quick Start

  1. Create a new Clean Architecture project.
scaffold ca --name my-app
  1. Move into the generated project directory.
cd my-app
  1. Generate a domain model.
scaffold gm --name order
  1. Validate the project structure.
scaffold vs

Commands & Examples

scaffold ca

Scaffold a new Clean Architecture project.

scaffold ca --name my-project
scaffold ca --name my-project --dry-run

scaffold gm

Scaffold a Pydantic v2 domain model and its test stub.

scaffold gm --name order
scaffold gm --name order --dry-run

scaffold guc

Scaffold a use case in domain/usecase/.

scaffold guc --name create_order
scaffold guc --name create_order --dry-run

scaffold gda

Scaffold a driven adapter such as an HTTP client, secrets adapter, or generic outbound adapter.

scaffold gda --type rest-consumer
scaffold gda --type generic --name my_adapter --dry-run

scaffold gep

Scaffold an entry-point adapter for REST APIs, A2A agents, MCP servers, or generic entry points.

scaffold gep --type restapi
scaffold gep --type mcp --with-resources --with-prompts --dry-run

scaffold gh

Scaffold a helper utility module and its test stub.

scaffold gh --name json_parser
scaffold gh --name json_parser --dry-run

scaffold gpipe

Scaffold a CI/CD pipeline configuration for GitHub Actions or Azure Pipelines.

scaffold gpipe --provider github
scaffold gpipe --provider azure --dry-run

scaffold vs

Scan the project for Clean Architecture import violations.

scaffold vs
scaffold vs --dry-run

scaffold dm

Delete a previously generated module and its mirrored test file.

scaffold dm --name order
scaffold dm --name order --dry-run

scaffold up

Update project dependencies using uv lock --upgrade and uv sync.

scaffold up --dry-run
scaffold update-project --dry-run

Technologies

Tool / Library Version Role
Python >=3.13 Runtime
uv latest Dependency management, build, and publish
Typer >=0.27.2 CLI framework
Rich >=15.0.0 Terminal output formatting
Jinja2 >=3.1 Template engine for code generation
Pydantic v2 >=2.0 Runtime validation of template context
hatchling latest Build backend
uv-dynamic-versioning latest PEP 440 versioning from git tags
ruff latest Linting and formatting
mypy latest (strict) Static type checking
pytest + pytest-cov latest Test execution and coverage gating

Current Features

  • Generates full Clean Architecture project skeletons with scaffold ca.
  • Generates domain models with scaffold gm.
  • Generates domain use cases with scaffold guc.
  • Generates driven adapters with scaffold gda.
  • Generates entry points for REST API, agent, MCP, and generic modes with scaffold gep.
  • Generates helper utilities with scaffold gh.
  • Generates CI/CD pipeline files with scaffold gpipe.
  • Validates import boundaries with scaffold vs.
  • Deletes generated modules safely with scaffold dm.
  • Updates project dependencies with scaffold up.
  • Supports --dry-run previews across commands.
  • Uses Jinja2 templates for all generated code.
  • Validates template context with Pydantic v2.
  • Formats terminal output with Rich.
  • Enforces static checks with mypy strict and ruff.
  • Maintains an 80%+ coverage gate with pytest-cov.

Contributing

  1. Fork the upstream repository on GitHub: https://github.com/bancolombia/scaffold-clean-architecture-py
  2. Clone your fork.
git clone https://github.com/YOUR-USER/scaffold-clean-architecture-py.git
cd scaffold-clean-architecture-py
  1. Set up the development environment.
uv sync
  1. Create a feature branch.
git checkout -b your-branch-feature-name
  1. Run the test suite.
uv run pytest
  1. Check linting.
uv run ruff check src tests
  1. Check types.
uv run mypy src
  1. Commit your changes and open a pull request.

License

This project is licensed under the MIT License. See LICENSE for the full text.

Metadata

Release files for scaffold-ca-python 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scaffold-ca-python 0.1.4
File Size Uploaded
scaffold_ca_python-0.1.4.tar.gz 368.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scaffold-ca-python 0.1.4
File Interpreter ABI Platform
scaffold_ca_python-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 455.6 kB

Release files / scaffold_ca_python-0.1.4.tar.gz

Download URL scaffold_ca_python-0.1.4.tar.gz
Size 368.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3c5b2b9902eedfa907ab849db19f2ec06fab823c8bf08fe7fb5889a7201b1192
BLAKE2b-256 checksum
How to use checksums
4e341e2c80bb79580f9841f13a23ad9ba924769034518a927ed0a28c4b633d2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / scaffold_ca_python-0.1.4-py3-none-any.whl

Download URL scaffold_ca_python-0.1.4-py3-none-any.whl
Size 87.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
826e6c453d3d091ebcd53e0b445d5361ee2ad3b8c3eafc3aa2104887c48f6404
BLAKE2b-256 checksum
How to use checksums
b7c880259a2f922f96d032ba8cd3a6f3594775d5ddd82e81f29bbb26d2b7d038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page