Utilities
Format one Python file with Black
black-format is a single-file Python formatting node powered by Black with fixed stable defaults.
overview
What black-format does
Read one Python source file and return a separate file formatted by Black with stable default style and an AST safety check. The default line-length target is 88; project configuration and the formatter cache are disabled. The Python input is parsed rather than executed.
Input is limited to 1 MiB and formatting to 60 seconds. Normalized .txt filenames work. Empty Python source is accepted; syntax/formatting errors fail without partial output. Notebooks and typing stubs are outside this contract.
Input or native processing failures fail the operation. The operation keeps the supplied source unchanged.
This operation uses 26.5.1. Upstream license: MIT. The source link identifies the program used by this node.
use cases
Where black-format fits
Format a Python snippet
Return a formatted copy of one Python file.
Preserve the original source
Keep the original bytes while reviewing Black output.
Apply a fixed formatting style
Use stable defaults without importing a repository pyproject.toml.
reference
black-format inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| input | FILE | --input | Python source file up to 1 MiB. Filename extension is irrelevant. Uses default 88-column style, ignores project config, and has a 60-second timeout. |
Showing key inputs. black-format exposes 1 inputs in total.
example
Run black-format
/app/run.sh --input ./input.txt ./output# Fixture café
def add(a, b=1):
return a + b
values = {"a": 1, "b": [2, 3]}guidance
Choosing black-format
Use Black for a formatted source artifact. The published ruff-check node reports Python lint diagnostics and does not expose Ruff format. Runtime tests require a test runner.
ruff-check
Reports Python lint diagnostics without formatting files.
faq
black-format questions
related
More Utilities tools
browser-fetch
Headless Chromium render: requested URL, final URL, status, and title next to the page.
cewl
Spider a URL and return a wordlist for password crackers.
csvkit
SQL on one CSV. The table name is the file stem.
dnsgen
Wordlist and mined-word subdomain permutation.
duckdb
In-process SQL on CSV, JSON, and Parquet. No server.
edge-tts
Microsoft Edge neural speech from text or a script file. No API key.
Run black-format yourself
The synthetic run checks formatted python. The excerpt shows exact text asserted by saved passing platform verifier; recovered from fixture assertion, not a newly downloaded artifact. The command shown is the container entrypoint with example paths, not a host-installed CLI command.
Facts on this page come from the live Trickest tool library.