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 CreateOrder
scaffold guc --name CreateOrder --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 MyAdapter --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 JsonParser
scaffold gh --name JsonParser --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.16.0 CLI framework
Rich >=14.1.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/santicalleg/scaffold-ca-python
  2. Clone your fork.
git clone https://github.com/YOUR-USER/scaffold-ca-python.git
cd scaffold-ca-python
  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.2

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.2
File Size Uploaded
scaffold_ca_python-0.1.2.tar.gz 353.7 kB Details

Built distribution (wheel)

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

Total release size: 439.7 kB

Release files / scaffold_ca_python-0.1.2.tar.gz

Download URL scaffold_ca_python-0.1.2.tar.gz
Size 353.7 kB
Tags Source
SHA-256 checksum
How to use checksums
91cb79e47d7a87118b646f560f1622cfe0c81c52eb49f3bff117e8dabb622b72
BLAKE2b-256 checksum
How to use checksums
636bd44717093321697dafa29f31c2a7371e2397a535720fe35a5011a23f7c5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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.2-py3-none-any.whl

Download URL scaffold_ca_python-0.1.2-py3-none-any.whl
Size 86.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c558c16eff5488b83d591515d7b8d7d4db4b4021a5592fcd75ac0fa71796af35
BLAKE2b-256 checksum
How to use checksums
22a6e0eb90572056b8d4b08d04a7911daff27bfa5d2122e26d0bab55e6ecb685
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","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

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.2 This release

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