---
title: "python code formatter and linter - codefmt"
url: https://codefmt.dev/python
updated: 2026-08-24
sources:
  - https://codefmt.dev/python
licence: "© codefmt. Cite with attribution to https://codefmt.dev."
---

# python formatter and linter for automation platforms

codefmt formats and lints Python for Zapier, n8n, Pipedream, Make, and HubSpot Data Hub code steps with Ruff, running entirely in your browser via WebAssembly. it understands each platform's injected globals (input_data in Zapier, _items in n8n, pd in Pipedream) so your snippet parses and lints cleanly without a local Python install.

## what the tool does

- formats with Ruff's Black-compatible formatter: 88-character lines, 4-space indentation, magic trailing comma support
- lints with a curated Ruff rule set (Pyflakes, pycodestyle, isort, pep8-naming, pyupgrade, bugbear, bandit security, comprehensions, simplify, and Ruff-specific rules)
- wraps your snippet in the platform's runtime shell so platform globals are not flagged as undefined
- formatting and linting run in your browser via WebAssembly, so no Python install is needed

## frequently asked questions

### what formatter engine powers the python formatting?

codefmt uses Ruff for all python formatting and linting. Ruff is a rust-based python tool with a Black-compatible formatter. Ruff's own benchmarks put its formatter over 30x faster than Black, with matching output in nearly all code. formatting runs entirely in your browser via WebAssembly, so no python installation is needed.

### what lint rules are available for python?

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.

### which automation platforms support python code actions?

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.

### what is the default line length and indentation for python formatting?

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.

### how does magic trailing comma work in python formatting?

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.

## for agents and automation

- format API: POST https://codefmt.dev/api/format (OpenAPI: https://codefmt.dev/api/openapi.json, 50KB max code, no authentication)
- MCP server: POST https://codefmt.dev/api/mcp (tools: format_code, format_json, ask_codefmt)
- site index for agents: https://codefmt.dev/llms.txt
