# Fastapi Python General Coding Standards

> 应用一般 Python 编码标准，包括类型提示、使用 Pydantic 进行输入验证、后台任务、CORS 处理、安全工具、PEP 8 合规性和全面测试。

- Skill: `liaosw97/fastapi-python-general-coding-standards` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add liaosw97/fastapi-python-general-coding-standards`
- Raw SKILL.md: https://api.skillmd.com/api/skills/liaosw97/fastapi-python-general-coding-standards/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: liaosw97 (https://skillmd.com/u/liaosw97)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/liaosw97/fastapi-python-general-coding-standards

---


- 对所有函数参数和返回值使用类型提示
- 使用 Pydantic 实现适当的输入验证
- 对长时间运行的操作使用 FastAPI 的后台任务
- 实现适当的 CORS 处理
- 使用 FastAPI 的安全工具进行认证
- 遵循 Python 代码的 PEP 8 风格指南
- 实现全面的单元和集成测试

