python-patterns

Guide Python development decisions on frameworks, async patterns, and type hinting.

1|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/danilomartinelli/cursor-kit --skill python-patterns-danilomartinelli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-patterns
Source: https://github.com/danilomartinelli/cursor-kit/tree/main/skills/python-patterns
Command: npx skills add https://github.com/danilomartinelli/cursor-kit --skill python-patterns-danilomartinelli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers make informed decisions about Python frameworks, asynchronous programming, type hinting, project structure, and error handling, promoting best practices and efficient development.

Core Features & Use Cases

  • Framework Selection: Guides users to choose the right Python web framework (FastAPI, Django, Flask) based on project needs.
  • Async vs. Sync: Provides clear criteria for deciding when to use asynchronous programming.
  • Type Hinting & Validation: Explains the importance and application of type hints and Pydantic for robust code.
  • Project Structure: Offers principles for organizing Python projects of varying sizes.
  • Error Handling & Testing: Outlines strategies for effective error management and testing.
  • Use Case: A developer is starting a new API project and is unsure whether to use FastAPI or Django. This Skill provides a decision tree and comparison principles to help them make the optimal choice.

Quick Start

Use the python-patterns skill to understand when to use async def versus def in FastAPI.

Frequently Asked Questions about python-patterns

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

FAQPage Schema
When should I use async def versus def in FastAPI?

Use async def in FastAPI when endpoints perform I/O-bound operations like database queries, and standard def for CPU-bound tasks. This Skill provides clear criteria for deciding when asynchronous programming is appropriate.

How do I choose between FastAPI and Django for a new Python API project?

Choosing between FastAPI and Django depends on needing high performance and type validation versus a batteries-included monolithic framework. This Skill provides decision tree principles to help select the optimal Python web framework.

What are the best practices for type hinting and validation in Python?

Best practices for type hinting in Python involve applying type hints and Pydantic for robust code validation. This Skill explains the importance and application of these strategies to ensure data integrity.

How should I structure a Python project to maintain best practices?

Structuring a Python project according to best practices requires following specific organizational principles based on project size. This Skill offers guidelines for organizing Python projects of varying scales.

What strategies should I use for error handling and testing in Python?

Effective error handling and testing in Python require structured strategies for error management and test coverage. This Skill outlines approaches for handling errors and testing to build resilient applications.