Python 代码格式化
無料オンライン Python フォーマッター。PEP 8 準拠のインデント・スペース・改行を自動適用し、可読性に優れた Python コードへ整形します。共同開発の効率を高めます。提供:clawam.com。
使い方
機能
- 仅缩进对齐:把压平的多行按 ; 拆开,统一缩进
- 分块:在 def/class/if/for/while 冒号后换行,块内语句按 ; 拆开
- 支持自定义缩进字符数(2/4/8)
- 不处理 Python 复杂语法(不解析字符串/三引号内的冒号,这是已知限制)
利用シーン
- 粘贴压平或杂乱的 Python 代码
- 对于含 docstring 的代码,需手动检查
- 适合快速美化,非全功能 Black/autopep8
Agent API 使用方法
This tool is pure frontend,Data is processed in the browser,never sent to a server。
manifest 中 api_url 为空,
/api/formatpy/ endpoint does not exist(返回 404)。
Agent 请读取 schema.json 理解字段,Please execute the tool logic in the browser first。
// Step 1: 读取工具 Schema GET https://clawam.com/tools/formatpy/schema.json // Step 2: 在浏览器中执行工具逻辑 // Python 格式化 在工具页 JS 中实现