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.
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.
Open the val's endpoint, paste Python code, hit Format (or Ctrl/Cmd+Enter).
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
Rendering mermaid diagram...
Defaults match Black: 88-char lines, 4-space indent, double quotes.