python-patterns

Guide Python architecture decisions for frameworks, async or sync execution, typing, and project organization.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/capaas2/Site-teste --skill python-patterns-capaas2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-patterns
Source: https://github.com/capaas2/Site-teste/tree/main/.agent/skills/python-patterns
Command: npx skills add https://github.com/capaas2/Site-teste --skill python-patterns-capaas2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you choose the right Python framework, concurrency model, typing approach, and project structure based on the actual problem you are solving, instead of relying on defaults or copy-paste habits.

Core Features & Use Cases

  • Framework Selection: Compare FastAPI, Django, and Flask for APIs, full-stack apps, admin panels, and simple scripts.
  • Async vs Sync Decisions: Decide when to use async code for I/O-heavy workloads and when sync code is better for CPU-bound or blocking tasks.
  • Type Hints and Validation: Apply practical typing and Pydantic validation strategies for public APIs, models, and data contracts.
  • Project Structure Guidance: Organize small, medium, and large Python projects with clear layers for routes, services, models, and schemas.
  • Use Case: A developer building an AI API can use this Skill to decide whether FastAPI with async database access is the best fit and how to structure the app cleanly.

Quick Start

Ask for a Python architecture recommendation for your project, including the best framework, async or sync approach, and a suggested folder 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?

Choosing between FastAPI, Django, and Flask depends on your app type: FastAPI excels for async APIs, Django suits full-stack apps with admin panels, and Flask fits simple scripts and lightweight services.

When should I use async or sync execution in Python?

Use async execution in Python for I/O-heavy workloads like database access, and choose sync code for CPU-bound or blocking tasks to optimize concurrency strategy and performance.

What is the best way to structure a FastAPI project with type hints and validation?

The best way to structure a FastAPI project is organizing clear layers for routes, services, models, and schemas, applying practical type hints and Pydantic validation for data contracts.

Does my AI service need async database access with FastAPI?

Your AI service needs async database access with FastAPI if it handles I/O-heavy workloads, ensuring scalable code structure and efficient concurrency for API-first applications.

How do I organize a large Python project layout for testable services?

Organize a large Python project layout by establishing clear layers for routes, services, models, and schemas, ensuring scalable code structure and testable services across medium and large systems.