backend-python

Scaffold FastAPI backends with SQLAlchemy 2.0 and Pydantic v2.

6|Updated Dec 7, 2025
One-click install
npx skills add https://github.com/timequity/plugins --skill backend-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-python
Source: https://github.com/timequity/plugins/tree/main/craft-coder/backend-python
Command: npx skills add https://github.com/timequity/plugins --skill backend-python

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

A comprehensive blueprint for building Python backends using FastAPI, SQLAlchemy 2.0, Pydantic v2, and modern tooling.

Core Features & Use Cases

  • Frameworks & ORM: FastAPI, SQLAlchemy 2.0, Pydantic v2, uv, and dev tooling.
  • Project Setup: Setup instructions for a complete Python API backend.
  • Best Practices: Dependency injection, async DB patterns, settings management.

Quick Start

Scaffold a FastAPI app with SQLAlchemy and Pydantic; run with uvicorn.

Frequently Asked Questions about backend-python

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

FAQPage Schema
How do I build a FastAPI backend with SQLAlchemy and Pydantic?

FastAPI with SQLAlchemy 2.0 and Pydantic v2 provides a modern Python backend stack for building type-safe APIs. This approach combines async request handling, ORM-based database interactions, and automatic request validation into a cohesive framework suitable for production APIs and async services.

What's the best way to set up dependency injection in a FastAPI application?

FastAPI's built-in dependency injection system wires services, database sessions, and configuration into route handlers declaratively. The Skill covers patterns for organizing dependencies, managing async SQLAlchemy sessions, and structuring reusable components across your codebase.

How do I use async SQLAlchemy with FastAPI?

Async SQLAlchemy integrates with FastAPI's async runtime to perform non-blocking database operations. This Skill demonstrates async session management, proper connection pooling, and query patterns that leverage both frameworks' asynchronous capabilities without blocking the event loop.

Can I use Pydantic v2 for request validation and ORM schema mapping?

Pydantic v2 validates incoming API requests and serializes ORM model instances to JSON. This Skill shows how to define validation schemas, map Pydantic models to SQLAlchemy entities, and handle serialization with type safety across your FastAPI endpoints.

What testing patterns work with FastAPI, SQLAlchemy, and Pydantic?

Testing a modern Python backend requires fixtures for database setup, test clients for API routes, and factories for generating valid test data. This Skill covers integrated linting, formatting, and testing tooling alongside patterns for isolating units and mocking dependencies.

How do I manage environment configuration in a FastAPI backend?

Settings management separates environment variables from application logic using Pydantic for validation. This Skill demonstrates how to load, validate, and inject configuration across FastAPI services, supporting development, testing, and production deployment scenarios.