Docs | |
GitHub | |
Code style | |
License |
Cookiecutter / Cruft template for a Python package, based on [audreyfeldroy] and [radix-ai] Cookiecutter packages.
- Cruft: Keeps the project templates up-to-date
- Poetry: A tool for dependency management and packaging in Python
- Auto-release to PyPi when you push a new tag to main branch (optional)
- Ruff and Black: Ensure your code is clean and adheres to style guidelines with automated code linting and formatting.
- Pre-commit: Managing and maintaining multi-language pre-commit hooks to ensure code quality
- Static type checking with Mypy and data validation using Pydantic's type annotations
- Automatic check for dependency updates with Dependabot
- Testing setup with
unittest
andpytest
- tox testing: Setup to easily test for Python 3.10 and 3.11
- Test coverage with Coverage.py
- Ready-to-go setup documentation with MkDocs' theme Material for MkDocs and PyMdown Extensions.
- Hosting of documentation in Read the Docs or [Gihub Pages].
- Commitizen: Streamline your versioning workflow with semantic versioning and automatic changelog generation.
- Automated release notes drafting process as pull requests are merged into master with Release Drafter.
- Optional CLI using Click, Typer or argparse.
- Development tasks (lint, format, test, etc) wrapped up in a python CLI with Invoke.
For a brief tutorial, refer to the refer to the Tutorial section of the documentation.
The prompts that need to be filled during the creation of the package are described in Prompts.
An existing project can be updated to the latest template using:
cruft update
Any of the following alternatives is most mature than the current template, and recommended to use:
- audreyfeldroy/cookiecutter-pypackage: The original template from which this was forked. It also includes a detailed list of alternative templates.
- briggySmalls/cookiecutter-pypackage: A fork of audreyfeldroy/cookiecutter-pypackage using Poetry for neat package management and deployment, with linting, formatting, no makefiles and more.
- TezRomacH/python-package-template: Cookiecutter template that combines state-of-the-art libraries and best development practices for Python.
- radix-ai/poetry-cookiecutter: A modern Cookiecutter template for scaffolding Python packages and apps.
The following templates were used as basis and inspiration for the creation of some parts of this template:
- Initial template forked from audreyfeldroy/cookiecutter-pypackage.
- Implementation of Poetry is based in the templates TezRomacH/python-package-template and radix-ai/poetry-cookiecutter.
- Implementation of Invoke is based in briggySmalls/cookiecutter-pypackage.
- Use of release drafter, dependabot, and print instructions after the template is created: TezRomacH/python-package-template.