Skip to content

okotaku/template

Repository files navigation

Modern Python Template

CI/CD Documentation License Python uv Ruff Checked with pyright Claude Code Ready pre-commit Renovate

πŸ“˜ Documentation | πŸ› Report Bug | ✨ Request Feature | πŸ€– Claude Code Setup

πŸš€ Features

  • 🎯 Modern Python: Built for Python 3.12+ with latest language features
  • πŸ“¦ uv Package Manager: Lightning-fast dependency management
  • πŸ”§ Developer Tools: Pre-configured with Ruff, Pyright, and pre-commit
  • πŸ€– AI-First Development: Optimized for Claude Code workflows
  • βœ… Comprehensive Testing: Pytest with coverage, parallel execution, and benchmarking
  • πŸ”’ Security First: Integrated security scanning with Trivy and Bandit
  • πŸ”„ CI/CD Pipeline: Advanced GitHub Actions with reusable workflows
  • πŸ“ Type Safety: Full type annotations with strict checking
  • 🎨 Code Quality: 15+ pre-commit hooks for consistent code
  • πŸ”„ Auto Updates: Renovate bot for dependency management

πŸ“‹ Table of Contents

πŸƒ Quick Start

# Clone the repository
git clone https://github.com/okotaku/template.git
cd template

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync --all-extras

# Run the CLI
uv run template --name "Your Name"

# Run tests
uv run pytest

πŸ› οΈ Installation

Prerequisites

  • Python 3.12 or higher
  • uv package manager (recommended) or pip

Installing uv

macOS and Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Using pip
pip install uv

Setting up the project

  1. Clone the repository

    git clone https://github.com/okotaku/template.git
    cd template
  2. Install dependencies

    uv sync --all-extras
  3. Install pre-commit hooks

    uv run pre-commit install
  4. Verify installation

    uv run template --version

πŸ“– Usage

Command Line Interface

The template provides a simple CLI for demonstration:

# Show help
uv run template --help

# Basic greeting
uv run template

# Personalized greeting
uv run template --name Alice

# Verbose output
uv run template --verbose

As a Python Package

import modules

# Get version
print(modules.__version__)

# Use functions
print(modules.hello())
print(modules.greet("World"))

πŸ”§ Development

Running Tests

# Run all tests
uv run pytest

# Run with coverage
uv run pytest --cov

# Run in parallel
uv run pytest -n auto

# Run specific test file
uv run pytest tests/test_basic.py

# Run with verbose output
uv run pytest -v

Code Quality

# Run all pre-commit hooks
uv run pre-commit run --all-files

# Run specific hooks
uv run ruff check . --fix
uv run ruff format .
uv run pyright modules

# Check types
uv run pyright modules tests

Additional Resources

# View changelog
cat CHANGELOG.md

# View comprehensive development guide
cat CLAUDE.md

# View project structure
ls -la

πŸ“ Project Structure

template/
β”œβ”€β”€ modules/                # Source code
β”‚   β”œβ”€β”€ __init__.py        # Package exports
β”‚   β”œβ”€β”€ cli.py             # CLI implementation
β”‚   β”œβ”€β”€ version.py         # Version management
β”‚   └── py.typed           # Type marker file
β”œβ”€β”€ tests/                 # Test suite
β”‚   β”œβ”€β”€ test_basic.py      # Basic tests
β”‚   └── test_cli.py        # CLI tests
β”œβ”€β”€ .github/               # GitHub configuration
β”‚   β”œβ”€β”€ workflows/         # CI/CD pipelines
β”‚   β”œβ”€β”€ actions/           # Reusable actions
β”‚   └── *.yml             # Various configs
β”œβ”€β”€ pyproject.toml         # Project metadata
β”œβ”€β”€ uv.lock               # Locked dependencies
β”œβ”€β”€ .pre-commit-config.yaml # Pre-commit hooks
β”œβ”€β”€ CLAUDE.md             # Claude Code config
└── README.md             # This file

🀝 Contributing

This project uses an AI-first development approach. Claude Code handles primary development while humans provide guidance and review. See CLAUDE.md for comprehensive development guidelines and AI-assisted workflows.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Make your changes
  4. Run tests and linting (uv run pre-commit run --all-files)
  5. Commit your changes (git commit -m 'feat: add amazing feature')
  6. Push to the branch (git push origin feat/amazing-feature)
  7. Open a Pull Request

Commit Convention

We use Conventional Commits:

  • feat: New features
  • fix: Bug fixes
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Test additions or modifications
  • chore: Maintenance tasks

πŸ“„ License

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

πŸ™ Acknowledgments

  • Built with uv for fast package management
  • Linted with Ruff for lightning-fast code quality
  • Type-checked with Pyright for robust type safety
  • Tested with Pytest for comprehensive test coverage
  • Automated with GitHub Actions for CI/CD
  • Optimized for Claude Code development

πŸ“Š Stats

GitHub stars GitHub forks GitHub watchers


Made with ❀️ by okotaku

⬆ Back to top

About

template repo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •