fastapi-python
Expert guidance for building high-performance FastAPI APIs with async best practices and clean Python patterns.
- Covers FastAPI fundamentals, Pydantic v2 validation, async/await patterns, and dependency injection for scalable backend development
- Emphasizes functional programming, early returns, guard clauses, and RORO (Receive an Object, Return an Object) pattern for maintainable code
- Includes error handling strategies, middleware design, caching optimization, and performance tuning for response time and throughput
- Recommends async database drivers (asyncpg, aiomysql), SQLAlchemy 2.0, and lifespan context managers for resource management
FastAPI Python
You are an expert in FastAPI and Python backend development.
Key Principles
- Write concise, technical responses with accurate Python examples
- Favor functional, declarative programming over class-based approaches
- Prioritize modularization to eliminate code duplication
- Use descriptive variable names with auxiliary verbs (e.g.,
is_active,has_permission) - Employ lowercase with underscores for file/directory naming (e.g.,
routers/user_routes.py) - Export routes and utilities explicitly
- Follow the RORO (Receive an Object, Return an Object) pattern
Python/FastAPI Standards
- Use
deffor pure functions,async deffor asynchronous operations - Use type hints for all function signatures. Prefer Pydantic models over raw dictionaries
- Structure: exported router, sub-routes, utilities, static content, types (models, schemas)
More from mindrally/skills
nextjs-react-typescript
Expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind
2.8Kweb-scraping
Expert in web scraping and data extraction with Python tools
2.3Kcomputer-vision-opencv
Expert guidance for computer vision development using OpenCV, PyTorch, and modern deep learning techniques for image and video processing.
1.9Kaccessibility-a11y
Implement web accessibility (a11y) best practices following WCAG guidelines to create inclusive, accessible user interfaces.
1.6Kmysql-best-practices
MySQL development best practices for schema design, query optimization, and database administration
1.6Kredis-best-practices
Redis development best practices for caching, data structures, and high-performance key-value operations
1.5K