Public
Black-style Python formatter (ruff WASM) with web UI + API
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

🐍 Python Black Formatter

Format Python code Black-style, right in the browser or via API. Powered by ruff's WASM formatter β€” a drop-in replacement for Black β€” so no Python runtime is needed.

Web UI

Open the val's endpoint, paste Python code, hit Format (or Ctrl/Cmd+Enter).

API

POST /format

  • JSON: {"code": "def f( ):pass", "line_width": 88} β†’ {"formatted": "..."}
  • Raw text: send Python source as the body β†’ formatted Python comes back as text
curl -X POST --data-binary @script.py <endpoint>/format

Files

Rendering mermaid diagram...

Defaults match Black: 88-char lines, 4-space indent, double quotes.