Python 형식ter

Free online Python Formatter. Simple JS-based indentation aligner that tidies up Python source code, pure frontend.

사용법

기능

  • 仅缩进对齐:把压平的多行按 ; 拆开,统一缩进
  • 分块:在 def/class/if/for/while 冒号后换行,块内语句按 ; 拆开
  • 支持自定义缩进字符数(2/4/8)
  • 不处理 Python 复杂语法(不解析字符串/三引号内的冒号,这是已知限制)

활용 사례

  • 粘贴压平或杂乱的 Python 代码
  • 对于含 docstring 的代码,需手动检查
  • 适合快速美化,非全功能 Black/autopep8

나이nt 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 中实现