python-patterns

Guide Python framework selection and project structure decisions.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/gensart-projs/cp-kit --skill python-patterns-gensart-projs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-patterns
Source: https://github.com/gensart-projs/cp-kit/tree/main/packages/cp-toolkit/templates/skills/python-patterns
Command: npx skills add https://github.com/gensart-projs/cp-kit --skill python-patterns-gensart-projs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides decision-making principles for Python development to guide framework selection, async vs sync choices, type hints, and project structure, emphasizing thinking over copying.

Core Features & Use Cases

  • Decision-tree guidance for selecting the right Python framework (FastAPI, Django, Flask) based on project needs.
  • Async vs Sync strategy and typing patterns to improve reliability and maintainability.
  • Clear project-structure principles with guidance on feature-based vs layered organization and validation strategies.
  • Practical use-case scenarios and concrete decisions to apply in real projects.

Quick Start

Describe your Python project context and I will guide you through choosing a framework, an async approach, and a scalable project structure.

Frequently Asked Questions about python-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between FastAPI, Django, and Flask for my Python project?

Python framework selection depends on your project needs: FastAPI suits async API services, Django handles full-stack web apps with built-in features, and Flask fits lightweight scripting tasks. Describe your project context to get decision-tree guidance for selecting the right framework.

When should I use async versus sync Python for API services?

Async Python benefits API services handling concurrent I/O operations, while sync Python suits simpler scripting tasks. Your async vs sync strategy depends on project structure needs and reliability requirements, with FastAPI supporting native async patterns for improved maintainability.

What's the best way to structure a scalable Python project with type hints?

Scalable Python project structure uses feature-based or layered organization with Pydantic type hints for validation. Clean architecture principles guide project-structure decisions, separating concerns to improve maintainability and support framework-specific patterns.

Does Python architecture really need Pydantic for type hints and validation?

Pydantic type hints improve Python reliability and maintainability by enforcing validation strategies. For API services and web apps, type hints with Pydantic provide clear structure and data validation, though simpler scripting tasks may need less strict typing patterns.

How do I architect Python wisely for web apps versus scripting tasks?

Architecting Python wisely means applying decision-making principles rather than copying templates. Web apps need framework selection with clean architecture and async options, while scripting tasks require clear structure and appropriate type hints based on project context.

Can I use the same Python project structure for different framework selections?

Python project structure adapts to your framework selection: FastAPI and Flask favor feature-based organization, while Django uses its conventional layered structure. Clean architecture principles apply across choices, but concrete decisions depend on your specific project needs.