Skip to content

A Python project starter template with pre-configured tools for code formatting, linting, static analysis, doc checks, and security auditing. Includes Poetry setup and Taskfile automation for easy development workflow.

License

Notifications You must be signed in to change notification settings

NKTKLN/python-project-template

Repository files navigation

🐍 Python Project Template

python-project-template is a starter template for Python projects with advanced setup for code quality tools, static analysis, formatting, documentation checks, and dependency security auditing.

This template includes configurations for poetry, ruff, black, mypy, pylint, pre-commit, and other popular tools, along with a ready-to-use Taskfile.yml for convenient task management.

📦 Dependencies

⚙️ Configuration & Features

The project comes pre-configured with:

  • Code formatting via black, isort, ruff
  • Static code analysis using ruff, mypy, pylint
  • Docstring style checks via interrogate
  • Dead code detection with vulture
  • Dependency vulnerability auditing using pip-audit
  • Unused library checks via deptry
  • pre-commit hooks setup for Git

All settings target Python 3.12+ with a max line length of 88 characters.

🛠️ Installation & Usage

💻 Local Setup

  1. Make sure you have Python 3.12 or newer installed.

  2. Install dependencies:

    poetry install --no-root
  3. Install Git hooks via pre-commit:

    poetry run pre-commit install
  4. Run the application (example module app.main):

    poetry run python -m app.main

🐳 Running with Docker

  1. Build the Docker image:

    docker build -t python-app .
  2. Run the container:

    docker run -it --rm python-app

🤖 Using Taskfile

To simplify project tasks, you can use the included Taskfile.yml:

  • Install dependencies:

    task install
  • Format code:

    task format
  • Run linting and static analysis:

    task lint
  • Check docstring style:

    task docstyle
  • Find dead code:

    task deadcode
  • Audit dependencies for vulnerabilities:

    task audit
  • Run full check (formatting, linting, auditing, etc.):

    task check
  • Run the application:

    task run
  • Build and run Docker container:

    task docker

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A Python project starter template with pre-configured tools for code formatting, linting, static analysis, doc checks, and security auditing. Includes Poetry setup and Taskfile automation for easy development workflow.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published