This is a cookiecutter template for creating a Command Line Interface (CLI) python application framework that uses loguru for logging.
A local development environment is included that uses:
- Poetry Python packaging and dependency management.
- Task is a task runner / build tool.
- MkDocs Project documentation with Markdown.
- mkdocs-material Material theme.
- pytest unit testing.
- pytest-cov unit test coverage.
- tox multiple python testing.
- radon code metrics.
- Ruff an extremely fast Python linter and code formatter, written in Rust.
- FawltyDeps FawltyDeps is a dependency checker for Python that finds undeclared and/or unused 3rd-party dependencies in your Python project.
Several addition MkDocs plugins are used to proved automatic code reference in the documentation. No additional documentation configuration necessary. Just run:
task build
task docs
Then open http://127.0.0.1:8000 with your browser.
-
Install the task manager: Task
-
Install Poetry
-
Optionally install pyenv-installer
-
Install dependent pythons, example:
pyenv local 3.11.9 3.12.3
Note you may need to install some libraries for the pythons to compile cleanly. For example on ubuntu (note I prefer
nala
overapt
):
sudo nala install tk-dev libbz2-dev libreadline-dev libsqlite3-dev lzma-dev python3-tk libreadline-dev
-
Please look at the {{cookiecutter.project_slug}}/README.md
for framework details.
To create a new application using this template:
-
Run: cookiecutter https://github.com/royw/cookiecutter-clibones
After creating your new application skeleton, cd to the new project's directory then run:
git init .
# optionaltask build
# verify the framework builds cleanlytask main
# optional run the example applicationless README.md
# optional read the instructions ;-)
Start modifying the src/*/__main__.py
and add your application code...
Enjoy!