fastapi-patterns

FastAPI / Modern Python API

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "fastapi-patterns" with this command: npx skills add sraloff/gravityboots/sraloff-gravityboots-fastapi-patterns

FastAPI / Modern Python API

When to use this skill

  • Building high-performance APIs with FastAPI.

  • Defining Pydantic models.

  • Structuring API projects.

  1. Structure
  • Routers: Split routes into modules (app/routers/users.py ) and include them in main.py .

  • Dependencies: Use Dependency Injection (Depends() ) for DB sessions, auth, and shared logic.

  1. Pydantic Models
  • Separation: Create separate models for Input (UserCreate ), Output (UserResponse ), and Database (UserDB ).

  • Validation: Use strict Types and Field(...) for validation metadata.

  1. Async
  • Def vs Async Def: Use async def for endpoints that await I/O (DB, HTTP). Use def only if blocking CPU.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

test-driven-development

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

python-async-concurrency

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

python-core-idioms

No summary provided by upstream source.

Repository SourceNeeds Review
General

caddy-modern-config

No summary provided by upstream source.

Repository SourceNeeds Review