About fastapi
fastapi is a skill that guides developers building REST and asynchronous APIs with FastAPI. It covers routing, Pydantic models, dependency injection, documentation, and deployment practices.
Key features
- 01Build REST and asynchronous APIs
- 02Define routes and request parameters
- 03Model and validate data with Pydantic
- 04Use dependencies, OAuth2, and background tasks
- 05Configure middleware and OpenAPI documentation
Use cases
- 01Create API endpoints with request validation
- 02Structure dependencies and OAuth2 authentication
- 03Add background tasks or WebSocket handling
- 04Prepare API documentation and deployment configuration
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ full-stack-skills/ python-skills --skill fastapiAfter installing, type/fastapiin Claude Code to confirm it loaded.
Bundled filesagents/openai.yamlLICENSE.txt
Details
From the project READMEWhen to use this skill
Use this skill whenever the user wants to:
- 用 FastAPI 编写 REST/异步 API、Pydantic 模型与依赖注入
- 配置路由、中间件、文档与部署
How to use this skill
- 核心:FastAPI()、@app.get/post、Path/Query/Body;Pydantic 模型与校验。
- 进阶:Depends、OAuth2、后台任务、WebSocket;OpenAPI 文档。
- 参考:https://fastapi.tiangolo.com/
Best Practices
- 模型与响应 schema 明确;异常与状态码统一。
- 异步与数据库连接池;安全与 CORS 配置。
Keywords
fastapi, 异步 API, Pydantic, OpenAPI
Comments
Markdown supported