Welcome to copier-py’s documentation!

copier-py

🐍 Modern Python project copier template

Python 3.11-3.13 GitHub Issues GitHub Pull Requests License


Each time you start a new Python project, you shouldn’t start from scratch. Ideally, you’d start with a standard project structure and set of tools and integrations to help facilitate writing quality Python code.

This modern Python copier template is the tool that will help you do just that. It is the copier equivalent of cookiecutter-py.


✨ Features

  • uv to manage dependencies

  • structlog for logging

  • mypy for static typing

  • pytest, hypothesis, mutmut for testing

  • tox for testing automation

  • sphinx for docs

  • pdbp for debugging

  • konch for shell configuration w/ ipython support

  • pre-commit hooks with comprehensive tooling:

  • dockerfile for development, testing, and production

  • dunamai for versioning

  • custom Justfile (run just)

  • stay up-to-date w/ configured dependabot

  • github-actions with ci, publish to pypi workflows w/ release-drafter integration

    • ci workflow (leveraging tox)

      • optional codecov integration for code coverage

    • publish workflow with configurable publishing to:

      • TestPyPI (optional, disabled by default)

      • PyPI (optional, disabled by default)

      • GitHub Packages (optional, disabled by default)

      • GitHub Release artifacts (optional, disabled by default)

      • Always builds and uploads artifacts to GitHub Actions for manual inspection

      • Integrated with release-drafter

    • auto approve / merge workflow

    • with these additional workflows:

      • codeql for security analysis

      • hadolint for Dockerfile linting

      • pr-size-labeling for PR size classification

      • pr-labeler for automated PR labeling

      • commitlint for commit message validation

      • trufflehog for secret scanning

      • docs for documentation publishing

      • release-drafter for automated release notes

  • optional direnv .envrc (with use uv layout)

  • built-in template updates via copier update

🚀 Getting Started

Prerequisites

Install copier

uv tool install copier
# pip install copier
# pipx install copier

🛠️ Usage

Copier

copier copy gh:ryankanno/copier-py /path/to/destination

Or with uv (no install needed):

uvx copier copy gh:ryankanno/copier-py /path/to/destination

Add --trust to allow the post-generation git init task to run automatically.

Note: If you want to use the auto approve / merge Dependabot workflow, make sure to create tags major, minor, patch so that Dependabot can tag its PRs. The workflow won’t merge anything with a major tag.

Updating Projects

Projects created with this template can be updated when the template evolves:

copier update /path/to/project

🔍 Details

Justfile Commands

The template includes a comprehensive Justfile with the following commands:

Development:

  • just install - Install dependencies using uv

  • just clean - Remove all build, test, and documentation artifacts

Testing & Quality:

  • just tests - Run all tests (fast, no coverage)

  • just tests -- path/to/test.py - Run specific tests

  • just tests -- --durations=10 - Show slow test durations

  • just coverage - Run tests with comprehensive coverage analysis

  • just lint - Run all linting checks via tox

  • just lint --fix - Auto-fix linting issues where possible

  • just pre-commit - Run pre-commit hooks

Documentation & Distribution:

  • just docs - Build Sphinx documentation

  • just dist - Build distribution packages

Utilities:

  • just tox -- <args> - Run tox with custom arguments

  • just watch <recipe> - Watch files and re-run commands on changes (with desktop notifications)

All commands use uv as the package manager and integrate with tox environments for consistency.

Docker

To build the container:

DOCKER_BUILDKIT=1 docker build .

To run the container (if you’ve installed the defaults):

docker run <image_id or tag> python -m foobar.foobar

Versioning

If you enable the PyPI workflow, versioning will happen via dunamai within the GitHub pipeline.

If instead, you prefer to version your package, please do it via uv version $(dunamai from any) as recommended in their documentation.

Configuration Variables

When you run copier, you’ll be prompted for various configuration options. Here are the key variables:

Project Information:

  • author_name - Your full name

  • author_email - Your email address

  • project_name - Human-readable project name

  • project_short_description - Brief description of your project

  • project_url - Project repository URL

  • project_license - License type (default: MIT)

  • github_repository_owner - GitHub username or organization

  • package_name - Python package name (snake_case)

  • version - Initial version number (default: 0.0.0)

Python & Dependencies:

  • python_version - Minimum Python version (default: 3.12)

  • supported_python_versions - Comma-separated list of supported versions

  • uv_version - Version of uv to use

  • tox_version - Version of tox to use

  • sphinx_theme - Documentation theme (select from multiple options)

Optional Features:

  • should_use_direnv - Include .envrc for direnv (default: true)

  • should_create_author_files - Include AUTHORS.rst (default: true)

  • should_install_github_dependabot - Enable Dependabot (default: true)

  • should_automerge_autoapprove_github_dependabot - Auto-approve/merge Dependabot PRs (default: true)

  • should_install_github_actions - Include GitHub Actions workflows (default: true)

  • should_upload_coverage_to_codecov - Upload coverage to Codecov (default: false)

Publishing Options:

  • should_publish_to_testpypi - Publish to TestPyPI on every main push (default: false)

  • should_publish_to_pypi - Publish to PyPI on release (default: false)

  • should_publish_to_github_packages - Publish to GitHub Packages on release (default: false)

  • should_attach_to_github_release - Attach build artifacts to GitHub releases (default: false)

Note: Even if all publishing options are disabled, the build job still runs and uploads artifacts to GitHub Actions for manual inspection.

🚧 Roadmap

See the open issues for a list of proposed features (and known issues).

☑️ TODO

  • add mutmut example to template

  • add hypothesis example to template

  • add licenses

  • add typeguard

  • version releases

  • update docs

🤝 Contributing

Contributions are very much appreciated.

  1. Fork the project

  2. Create your feature branch (git checkout -b feature/new-copier-feature)

  3. Commit your changes (git commit -m 'Added a new feature')

  4. Push to the feature branch (git push origin feature/new-copier-feature)

  5. Open a PR! 🎆

📝 License

Distributed under the MIT License. See LICENSE for more information.

📫 Contact

Ryan Kanno - @ryankanno

Project Link: https://github.com/ryankanno/copier-py

The MIT License (MIT)

Copyright (c) 2026, Ryan Kanno <ryankanno@localkinegrinds.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Indices and tables