python-package-copier-template#
python-package-copier-template is a template for creating and maintaining modern Python packages with a batteries-included baseline: current packaging practices, updated tooling, CI/CD automation, documentation scaffolding, and conventions that work well for both humans and code agents.
It is implemented as a Copier template and also published as a small Python CLI wrapper, so the most common entrypoint is:
The docs build runs that example non-interactively with defaults in a temporary directory.
The command shown is the general entrypoint, and the capture is one concrete example of it.
The wrapper decides whether to run copier copy or copier update by inspecting the destination directory for a Copier answers file.
If you want the details of how the wrapper resolves template versions and source locations, see CLI Reference.
If you prefer the raw Copier commands, or want the latest development version from GitHub, the details are in Getting Started.
A public example generated from the template lives at mgaitan/yet-another-demo. It is useful both as a smoke target and as a concrete reference for what the scaffold looks like in practice.
What this template includes#
A modern Python package baseline targeting Python 3.12+.
Dependency and environment management with uv.
Linting and formatting with Ruff.
Type checking with ty.
Testing with pytest, coverage, and related extensions.
Optional QA orchestration and git hook setup with prek.
Sphinx documentation written in Markdown with MyST.
GitHub Actions workflows for CI, docs publishing, template refreshes, and PyPI releases.
An
AGENTS.mdstarter so code agents have project-specific guidance from day one.Optional GitHub repository bootstrapping with GitHub CLI.
Generated projects that remain updatable with
copier update.
The broader rationale for these choices is described in the original blog post: My opinionated scaffolding for modern Python projects.
- Getting Started
- CLI Reference
- Adopt the Template in an Existing Project
- Maintain the Template
- Configuration
- Features and Decisions
- Copier template, plus a wrapper
- Python packaging defaults
- Dependency management with uv
- Dependency cooldowns
- Ruff for linting and formatting
- ty for type checking
- pytest for tests
- prek for orchestration and hooks
- Documentation with Sphinx and MyST
- GitHub automation
- Demo repository
- Trusted Publishing for releases
- Repository ergonomics
- Agent-facing guidance
- Updating generated projects
- AGENTS.md
- About the Documentation