Skip to content

A Python project starter template with pre-configured tools for code formatting, linting, static analysis, doc checks, and security auditing. Includes uv 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, testing, coverage control, dependency security auditing, and release automation.

This template uses modern tooling such as uv, ruff, mypy, pytest, pre-commit, commitizen, hatchling and gitleaks, along with a ready-to-use Taskfile.yml for convenient task management.

📦 Dependencies

⚙️ Configuration & Features

The project comes pre-configured with:

  • Code formatting and linting via ruff
  • Static type checking via mypy
  • Testing with pytest
  • Coverage reporting via coverage
  • Security auditing via pip-audit
  • Unused dependency detection via deptry
  • Conventional commits & versioning via commitizen
  • Git hooks via pre-commit
  • Secret scanning via gitleaks
  • Packaging with hatchling
  • Dependency management via uv

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

🛠️ Installation & Usage

💻 Local Setup

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

  2. Sync dependencies (including dev group):

task sync
  1. Install Git hooks:
task init
  1. Run the application (example module app.main):
task run

🐳 Docker

Build image:

task docker-build

Run container:

task docker-run

Build and run:

task docker

🧪 Development Commands

Auto-fix lint issues and format code:

task fmt

Run Ruff and MyPy:

task lint

Tests with Coverage:

task test

Security audit:

task audit

Detect unused libraries:

task unused-libs

Full Quality Check:

task check

🚀 Release Management

Commit using Conventional Commits:

task cz-commit

Check commit messages:

task cz-check

Bump version and update changelog:

task cz-bump

Release (bump + push tags):

task release

📜 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 uv setup and Taskfile automation for easy development workflow.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published