Skip to content

A medium complexity template for create CLI or python package.

License

Notifications You must be signed in to change notification settings

Dashstrom/python-template

Repository files navigation

Python template

Mypy Ruff Python : 3.9 3.10 3.11 3.12 3.13 License : MIT CI : Tests

Description

A medium complexity template for create CLI or python package.

Your gratitude warms my heart 💖

If you like this project or use it in your own project. Please, share it and add a little star for me ⭐

Tools used

  • Commitizen A tool to create committing rules for projects.
  • Cookiecutter A cross-platform command-line utility that creates projects.
  • Doctest Executes tests in docstrings
  • Editorconfig Configuration file format for defining coding styles in shared projects.
  • Git Git is the most widely used version control system.
  • Github Actions Automate and execute your software development workflows right in your repository.
  • Mypy Optional static typing for Python.
  • Poe the Poet A task runner that works well with poetry.
  • Pre-commit A framework for managing and maintaining multi-language pre-commit hooks.
  • Pytest Framework making it easy to write small tests, yet scales to support complex functional testing.
  • Ruff An extremely fast Python linter, written in Rust.
  • Sphinx with read the docs theme Sphinx makes it easy to create intelligent and beautiful documentation.
  • UV An extremely fast Python package and project manager, written in Rust.

Prerequisite

First, you will need to install a version of python higher or equal to 3.9. Then, you must install Visual Studio Code, uv and git.

Generate template

First you need to create your repository as follows:

uvx cookiecutter --accept-hooks yes gh:Dashstrom/python-template

Configuration

Enable GitHub pages

Go to https://github.com/GITHUB_USERNAME/PROJECT_NAME/settings/pages and change branch for GitHub Pages:

Configure GitHub Pages

Add description, website and tag

Go to https://github.com/GITHUB_USERNAME/PROJECT_NAME and follow instructions:

Configure GitHub Pages

Enable publish on PyPI

Create a PyPI account and go to bottom of this page

Configure PyPI

Testing

python tests/test_template.py

Green IT

For going further, you can use shrinkix for compress your images.