Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A comprehensive Copier template for modern Python projects with quality enforcement, AI-assisted development, Docker support, and extensive tooling. Features TDD workflows, multi-AI integration, and production-ready configurations.

License

NotificationsYou must be signed in to change notification settings

Atyantik/python-modern-template

Repository files navigation

A comprehensiveCopier template for modern Python projects with quality enforcement, AI-assisted development, and extensive tooling support.

Python VersionLicense: MITCode style: blackRuff


**New to Python or templates?Read the Complete Beginner's Guide

**Using AI coding assistants?See AI Setup Guide


Features

Core Features

  • Modern Python: Python 3.11-3.13 support with type hints
  • Fast Package Management: Usesuv for blazing-fast dependency management
  • Flexible Configuration: 20+ customization options via Copier
  • Production Ready: Docker, CI/CD, documentation out of the box

✅ Quality Enforcement (Optional)

  • Code Formatting: Black + isort for consistent style
  • Linting: Ruff + mypy + Pylint for code quality
  • Testing: pytest with coverage enforcement (80%+ default)
  • Security: Bandit for security vulnerability scanning
  • Pre-commit Hooks: 12+ automated checks before commits
  • Single Source of Truth: All configuration inpyproject.toml

**AI-Assisted Development (Optional)

  • Session Management: Track AI coding sessions with context
  • Multi-AI Support: Works with Claude Code, Cursor, GitHub Copilot, Google Gemini, and Aider
  • TDD Workflow: Integrated Test-Driven Development guidelines
  • Comprehensive Guides: 5 detailed AI documentation files
  • Project Context: Automatic context preservation across sessions

Docker & Documentation (Optional)

  • Multi-stage Dockerfile: Optimized production builds
  • Docker Compose: Full service orchestration
  • MkDocs Material: Beautiful documentation sites
  • Auto-generated API Docs: Using mkdocstrings
  • GitHub Pages Ready: Deploy docs with one command

Quick Start

Prerequisites

  • Python 3.11 or higher
  • uv (recommended) or pip
  • Copier 9.0.0 or higher

Installation

# Install Copier (choose one)pip install copier# oruv tool install copier

Create a New Project

Interactive Mode (Recommended)

copier copy gh:Atyantik/python-modern-template my-awesome-projectcd my-awesome-project

Smart Defaults: The folder name is automatically used as the default forproject_name andproject_slug:

  • my-awesome-project → Project: "My Awesome Project", Package:my_awesome_project
  • data_processor → Project: "Data Processor", Package:data_processor
  • backend-api-v2 → Project: "Backend Api V2", Package:backend_api_v2

You can still override these defaults during the interactive prompts.

Non-Interactive (Use Defaults)

copier copy --defaults gh:Atyantik/python-modern-template my-project

Custom Configuration

copier copy \  --data project_name="My Awesome Project" \  --data include_quality_scripts=true \  --data include_ai_tools=true \  --data include_docker=true \  gh:Atyantik/python-modern-template my-project

Example Configurations

We provide 7 ready-to-use example configurations:

ExampleFilesFeaturesBest For
Minimal15Basic structure onlyQuick prototypes
CLI Tool25Typer CLI + qualityCommand-line apps
Library2390% coverage, strict qualityPyPI packages
Data Science45Docker + docs + notebooksML/AI projects
Web API50Docker + PostgreSQLREST APIs
AI-Assisted40Multi-AI + session mgmtAI pair programming
Full-Featured68Everything enabledProduction apps

Seeexamples/README.md for detailed guides and commands.

Note: Example projects are generated locally on-demand usingexamples/generate-all.sh and are not tracked in git. This keeps the repository lightweight while providing fresh examples from the latest template.

Configuration Options

Project Settings

  • project_name: Human-readable project name (defaults to folder name, title-cased)
  • project_slug: Repository/slug name (defaults to folder name)
  • package_name: Python package name (derived from slug with underscores)
  • project_description: Short description
  • author_name: Your name
  • author_email: Your email
  • license: MIT, Apache-2.0, GPL-3.0, BSD-3-Clause, or Proprietary

Python Settings

  • python_version: 3.11, 3.12, or 3.13
  • min_python_version: Minimum required version
  • line_length: 79, 88, 100, or 120

Feature Flags

  • include_quality_scripts: Quality enforcement scripts (default: true)
  • include_ai_tools: AI session management (default: true)
  • include_docker: Docker support (default: false)
  • include_docs: MkDocs documentation (default: false)
  • include_pre_commit: Pre-commit hooks (default: true)
  • include_cli: CLI framework (default: false)

Quality Settings

  • min_coverage: Minimum test coverage % (default: 80)

AI Tools Presets

  • all: All AI tools (Claude, Cursor, Copilot, Gemini, Aider)
  • minimal: Just AGENTS.md (universal)
  • claude: Claude Code only
  • cursor: Cursor IDE only
  • custom: Pick individually

Project Structure

my-project/├── src/│   └── my_project/          # Your Python package├── tests/                   # Test files├── scripts/│   ├── quality/            # Quality check scripts (optional)│   └── ai_tools/           # AI session tools (optional)├── docs/                   # Documentation (optional)├── AI_DOCS/                # AI guides (optional)├── .github/│   └── workflows/          # CI/CD pipelines├── pyproject.toml          # Project configuration├── Makefile                # Common tasks├── Dockerfile              # Docker config (optional)├── docker-compose.yml      # Service orchestration (optional)├── mkdocs.yml              # Docs config (optional)└── README.md               # Project documentation

Development Workflow

Basic Commands

# Install dependenciesuv sync --all-extras --dev# Run testsmaketest# Run all quality checksmake check# Format codemake format# Run lintersmake lint# View coverage reportmake coverage# Serve documentation (if enabled)make docs-serve

AI-Assisted Development (if enabled)

# Start a new coding sessionmake ai-start TASK="Add user authentication"# Log progressuv run ai-log"Implemented login endpoint"# Update planuv run ai-update-plan"Complete login tests"# Get context summarymake ai-context# Finish sessionmake ai-finish

Docker (if enabled)

# Build imagemake docker-build# Run containermake docker-run# Start servicesmake docker-compose-up# Stop servicesmake docker-compose-down

**Using with AI Coding Assistants

This template is optimized for AI-powered development! Each AI assistant automatically reads its configuration file.

Quick Setup by AI Tool

AI ToolHow It WorksConfiguration File
Claude CodeAutomatically reads project instructionsCLAUDE.md
Cursor IDELoads rules on project open.cursorrules
GitHub CopilotVS Code extension reads instructions.github/copilot-instructions.md
Google GeminiReads style guide.gemini/styleguide.md
AiderUses YAML configuration.aider.conf.yml
Any AIUniversal instructionsAGENTS.md

What AI Assistants Know

When you open your project with an AI assistant, it automatically understands:

  • Test-Driven Development - Write tests before code
  • Quality Standards - Type hints, docstrings, 80%+ coverage
  • Project Structure - Where to put files
  • Make Commands -make test,make check, etc.
  • Session Tracking - Track progress across sessions (if AI tools enabled)

Step-by-Step: First Session with Claude Code

  1. Create your project:

    copier copy gh:Atyantik/python-modern-template my-projectcd my-project
  2. Open in Claude Code:

    • Claude automatically readsCLAUDE.md
    • It knows to write tests first, follow TDD
  3. Start coding with AI:

    make ai-start TASK="Add user authentication"
  4. Let AI help you code:

    • Ask: "Create a User class with email and password"
    • Claude will write tests first, then implementation
    • It will runmake test to verify
  5. Run quality checks:

    make check
  6. Finish the session:

    make ai-finish

Step-by-Step: Using with Cursor

  1. Create and open project:

    copier copy gh:Atyantik/python-modern-template my-projectcursor my-project# or open in Cursor IDE
  2. Cursor loads.cursorrules automatically

  3. Start with Cmd+K or Cmd+L:

    • Ask: "Add a function to validate email addresses"
    • Cursor follows TDD: writes tests first
    • It knows project conventions
  4. Test your changes:

    maketestmake check

Step-by-Step: Using with GitHub Copilot

  1. Create project and open in VS Code:

    copier copy gh:Atyantik/python-modern-template my-projectcode my-project
  2. Copilot reads.github/copilot-instructions.md

  3. Start coding:

    • As you type, Copilot suggests code following project standards
    • Suggestions include type hints and docstrings
    • Test files suggested when creating new modules
  4. Verify with quality checks:

    make check

For Complete Beginners

If terms like "TDD" or "make commands" are unfamiliar:

Read the Complete Beginner's Guide - Step-by-step explanations of everything!

Documentation

For Template Users

For Template Developers

Why This Template?

For Solo Developers

  • ✅ Quality enforcement built-in
  • ✅ AI coding assistant integration
  • ✅ TDD workflow for better code
  • ✅ Production-ready from day one

For Teams

  • ✅ Consistent project structure
  • ✅ Automated quality checks
  • ✅ Comprehensive documentation
  • ✅ CI/CD pipelines included

For Learning

  • ✅ Best practices enforced
  • ✅ Modern Python patterns
  • ✅ Type hints everywhere
  • ✅ Well-documented examples

Advanced Usage

Update Existing Project

cd my-projectcopier update

Generate Examples Locally

Want to see the example projects in action? Generate all 7 configurations locally:

cd examples./generate-all.sh

This creates:

  • 01-minimal-package/ - Basic structure (25 files)
  • 02-cli-tool/ - CLI with Typer (25 files)
  • 03-library/ - Library with 90% coverage (23 files)
  • 04-data-science/ - Data science with Docker (45 files)
  • 05-web-api/ - Web API with Docker (50 files)
  • 06-ai-assisted/ - AI tools enabled (40 files)
  • 07-full-featured/ - Everything enabled (68 files)

Each example is a fully working project you can explore and test.

Customize Template

  1. Fork this repository
  2. Modify files intemplate/ directory
  3. Updatecopier.yml configuration
  4. Test withcopier copy . test-project

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

Copyright © 2025Atyantik Technologies Private Limited

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

Acknowledgments

Contact


Star this repo if you find it useful!

Made with byAtyantik Technologies

About

A comprehensive Copier template for modern Python projects with quality enforcement, AI-assisted development, Docker support, and extensive tooling. Features TDD workflows, multi-AI integration, and production-ready configurations.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp