A cookiecutter for making new Python repositories.
This template is different from @audreyfeldroy's cookiecutter-pypackage because it uses the source layout and has lots of code quality assurance checks built in. If you're looking for something similar but not quite like this, try her package or see her list of alternatives.
I've written several blog posts outlining all the ideas that made it into this template:
Install cruft
with:
python -m pip install cruft
Run cruft
with:
cruft create https://github.com/cthoyt/cookiecutter-snekpack
Enter the requested information, then win! Remember, package names should only have letters, numbers, and underscores.
If you're working under version control, copy the repository into your folder tracked under git, commit the files, and push to your remote.
You can see an example repository of what happens right after you run these commands at https://github.com/cthoyt/snekpack-demo.
Your new python package will have the following:
src/
layoutpyproject.toml
(following PEP 621)tox
or nox
pytest
and treon
sphinx
8.0+ and sphinx-rtd-theme
3.0+ruff
docstr-coverage
pyroma
check-manifest
mypy
bump-my-version
uv build
uv publish
click
py.typed
file so other packages can use your type hints.gitignore
generated from gitignore.io.Feel free to adapt this template to your needs, but please credit me in your README and link back to https://github.com/cthoyt/cookiecutter-snekpack.
This cookiecutter package is licensed under the MIT License.