A practical cookiecutter template for starting ML projects quickly with a consistent structure, uv dependency management, and sane defaults.
- Project structure for data, docs, scripts, and source code
pyproject.tomlready foruv- Git bootstrap in the post-generation hook
- Optional CUDA-aware PyTorch source selection via
enable_cuda
- Python 3.10+
uvinstalledcookiecutterinstalled
Install cookiecutter from this repository root:
pip install -r requirements.txtCreate a new repository on GitHub first (no README, no .gitignore, no license).
Copy its SSH URL, for example:
git@github.com:your-org/your-repo.git
cookiecutter git@github.com:caetas/CookieCutter.gitDuring prompts:
- set
repo_nameto your GitHub repository name - set
repo_urlto the SSH URL you copied above - choose
enable_cuda(TrueorFalse)
The hook automatically attempts to:
- initialize git branches/tags
- add
originfromrepo_url - push branches/tags
- merge
cookiecutterintomain - run
uv sync --python <minimal_python_version>
If auth/network/permissions are not ready yet, run these in the generated project directory:
git remote add origin <repo_ssh>
git push --all
git push origin --tags
git checkout main
git merge cookiecutter
git push --set-upstream origin main
git branch -d cookiecutter
git push origin --delete cookiecutter
uv sync --python <min_version>project_name: Display/project namerepo_name: Repository name (used for slug)repo_url: Remote git URL (validated in post-gen)project_slug: Python package/folder slugorganization: Organization nameauthor_name,author_email: Package metadatadescription: Short project descriptionlicense: License selectionenable_cuda: Controls Windows CUDA vs CPU PyTorch source in generatedpyproject.tomlminimal_python_version: Minimum Python versionline_length: Formatting line lengthversion: Initial package version
- Linux: uses
pytorch-cu128source in generated project - Windows: uses CUDA source only when
enable_cuda=True, otherwise CPU source - macOS: falls back to default PyPI source
Pull requests are welcome, especially small and focused improvements to template usability.
- PyPackage
- cookiecutter-data-science
- python-best-practices-cookiecutter
- python-package-template
- MLOpsPython
- Kedro
- Hypermodern Python
See LICENSE.md.