A lean, no‑boilerplate Cookiecutter template for quickly scaffolding modern Python projects.
- Minimal – sets up just the essentials: packaging, tests, linting, Github CI/CD, and docs. No framework lock‑in.
- Single command setup –
cookiecutter gh:linem-davton/python-cookiecutter-minimalyields a ready‑to‑run project in seconds. - Automatic bootstrap – post‑generation script creates a
venv, installs requirements, initialises git on amainbranch, installs pre‑commit hooks and (optionally) pushes to GitHub. - Flexible licensing & tooling – pick MIT, BSD‑3‑Clause, Apache‑2.0, GPL‑3.0 or none; enable/disable GitHub Actions CI, PyPI/TestPyPI release workflows, and Read the Docs.
- Pure Python + Shell – no heavy dependencies; works the same on Linux, macOS, WSL, and CI.
# 1 · install Cookiecutter
pip install -U cookiecutter
# 2 · generate a project
cookiecutter gh:linem-davton/python-cookiecutter-minimal
# 3. Setup venv and install requirements
cd <project_slug>
./setup.sh
# 3 · run the tests (pytest)
cd <project_slug>
pytest -q| Prompt | Example input | Effect |
|---|---|---|
| project_name | "My Cool App" | Human‑readable name; becomes project_slug if not overridden |
| github_url | git@github.com:you/my‑cool‑app.git |
If set, post‑gen script adds remote and pushes the first commit |
| github_actions_ci | Yes/No |
Adds GitHub Actions workflow for lint + tests on each push/pull |
| pypi_release | Yes/No |
Adds workflow to publish to PyPI on tag |
| testpypi_release | Yes/No |
Adds workflow to publish to TestPyPI on tag |
| readthedocs | Yes/No |
Adds docs/ skeleton + RTD config |
| open_source_license | MIT, BSD-3, Apache-2.0, GPL-3.0, None |
Generates LICENSE file & badge |
See cookiecutter.json for defaults and full list. (raw.githubusercontent.com)
<project_root>/
├── {{ project_slug }}/ # your package
│ ├── __init__.py
│ └── main.py
├── tests/ # pytest tests
│ └── test_basic.py
├── requirements.txt
├── README.md # auto‑filled with badges
├── LICENSE # selected license text
├── .pre-commit-config.yaml # lint / test hooks
└── .github/workflows/ # optional CI / release YMLs
local_extensions.YearExtensioninjectscurrent_yearinto Jinja templates so your LICENSE always has the right year. (raw.githubusercontent.com)- Templates live at the repository root; dynamic files like
README.mdand workflows are rendered with Jinja2 conditionals. - Files under
.github/workflowsare copied without rendering to avoid CI YAML quoting issues (see_copy_without_render). (raw.githubusercontent.com)
- Fork & clone.
- Create a virtualenv and install dev requirements:
pip install -r dev-requirements.txt. - Run
pre-commit install. - Open a pull request – CI will run linting and template self‑tests.
This template itself is distributed under the MIT License. Generated projects will use whichever license you select at creation time.