Welcome! This is a template repository for Python projects, engineered for use as a GitHub template repository. To use the template, click on "Use this template" or use the GitHub CLI ( gh repo create your-repo-name --public --template br3ndonland/template-python
).
The template repo name can be replaced as shown in the quickstart section.
Install Hatch, rename the project, then install the project:
# set your names
repo_name="your-repo-name"
your_name="Your Name"
# update repo for new names
git mv "template_python" "${repo_name//-/_}"
git grep -l "Brendon Smith" | xargs sed -i "s|Brendon Smith|$your_name|g"
git grep -l "template_python" | xargs sed -i "s|template_python|${repo_name//-/_}|g"
git grep -l "template-python" | xargs sed -i "s|template-python|$repo_name|g"
# run tests to verify
hatch run coverage run
Documentation is built with Material for MkDocs.
The Vercel project configuration in vercel.json
can be used to deploy the docs to Vercel.
Another common approach, especially for Python, is to use cookiecutter. In a cookiecutter repo, the developer adds template variables throughout, like {{cookiecutter.repo_name}}
. When a user runs cookiecutter
using the template repository, the template variables are replaced with the information the user provides. This repo is simple enough that I haven't needed to add cookiecutter yet.
Copier and PyScaffold are similar to cookiecutter, with some additional benefits.