Template/boilerplate/reference project for a Python application (branches for different add-ons, e.g. like FastAPI)
- Clone & copy (cookiecutter, copier) or use this repo via GitHub directly, see create a repository from a template.
- Run
uv run pre-commit install. - Delete
CHANGELOG.mdand reset version inpyproject.tomlfor your app.
The base branch main includes only the most necessary parts of a python project:
gitconfig (gitignore for Python, gitattributes to ensure proper line endings in the repo)- uv setup (currently the fastest Python package manager (?))
- ruff for code formatting and linting
- mypy for static type checking
- commitizen for structured commits (= conventional commits) enabling automatic versioning and changelog update
# bump version (in `pyproject.toml` and update `CHANGELOG.md`) # ideally this is performed by your pipeline (e.g., on PR merge) cz bump --yes --annotated-tag --check-consistency
- pytest - yes, even for python notebooks ;)
- simple and optional json logging with loguru
- pre-commit config (enforcing all of the above)
You can include branches depending on your needs:
fastapi- Webservice with FastAPI
LOG_LEVEL=TRACE uv run python python_template/main.pyYou can have the env variables in .env.shared or customize it on the command line.
- Ruff - Configuration
- Conventional Commits - Quickstart
- Angular - Commit Message Guidelines
- commitizen - GitHub Actions
- mypy - cheat sheet
- loguru - Switching from Standard Logging to Loguru
Other Templates: