Skip to content

Copier-Astral

Copier-Astral

My opinionated Copier template for bootstrapping Python projects. Batteries included: linting, testing, CI/CD, docs, and containerization — all pre-configured and ready to go.

Built for my own workflow, but you're welcome to use it!

Tooling

Tool Purpose Benefit
uv Package management, venv, dependencies 10-100x faster than pip
ty Type checking Astral's new fast type checker
ruff Linting + formatting Replaces flake8, black, isort
pytest Testing Industry standard
hatch Multi-version testing Matrix testing with envs
MkDocs Documentation Material theme + mkdocstrings
prek Git hooks Code quality enforcement
Typer CLI framework Type-hint based, modern
git-cliff Changelog Auto-generated from conventional commits
Gitleaks Secret scanning Detects hardcoded secrets in git history
pysentry-rs Dependency scanning Finds known vulnerabilities in Python deps
Semgrep SAST Static analysis for security vulnerabilities

Quick Start

Prerequisites

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Install copier with uv (recommended):

uv tool install copier
uv tool inject copier copier-template-extensions

With pipx:

pipx install copier
pipx inject copier copier-template-extensions

With pip:

pip install copier copier-template-extensions

Generate a Project

copier copy --trust gh:YOUR_USERNAME/copier-astral my-project

Or from a local clone:

copier copy --trust /path/to/copier-astral my-project

Note

The --trust flag is required because this template uses custom Jinja2 extensions for features like auto-detecting git user info and generating slugified package names. These extensions are safe to use but Copier warns about them by default.

Once your project is generated, head over to the User Guide for next steps.