codefmt formats and lints python for every platform that ships a python code action: zapier, n8n, pipedream, make, and hubspot data hub. this page opens in python mode, so you can paste and format right away.
python formatting and linting are powered by ruff, the fastest python linter and formatter, written in rust, with 500+ lint rules and black-compatible formatting. it runs entirely in your browser via webassembly. no python installation needed.
also format code for make, hubspot, and hubl. other tools: json formatter, snippets, chrome/firefox extension.
codefmt uses Ruff for all python formatting and linting. Ruff is a rust-based python tool that is fully Black-compatible. it produces the same output as Black but runs orders of magnitude faster. formatting runs entirely in your browser via WebAssembly, so no python installation is needed.
codefmt enables a curated set of Ruff lint rules: F (Pyflakes), E/W (pycodestyle errors and warnings), I (isort import sorting), N (pep8-naming), UP (pyupgrade), B (flake8-bugbear), S (flake8-bandit security), C4 (flake8-comprehensions), SIM (flake8-simplify), and RUF (Ruff-specific rules). this gives you 500+ checks covering correctness, security, and style.
Zapier, n8n, Pipedream, Make, and HubSpot Data Hub all support python code actions. select any of these platforms in codefmt, then toggle the js/py switch to enter python mode. codefmt understands each platform's python runtime globals and won't flag them as undefined.
codefmt uses 88 characters line length and 4-space indentation, the PEP 8 and Black standard. this matches what Ruff and Black produce by default, so your code will be consistent with the broader python ecosystem.
when you add a trailing comma after the last element in a list, dict, function call, or function signature, Ruff's formatter will keep the collection expanded across multiple lines, even if it would fit on one line. removing the trailing comma allows the formatter to collapse it back to a single line. this gives you explicit control over multiline formatting.
paste code to format, or