🌐
GitHub
github.com › psf › black
GitHub - psf/black: The uncompromising Python code formatter · GitHub
The uncompromising Python code formatter. Contribute to psf/black development by creating an account on GitHub.
Starred by 41.4K users
Forked by 2.7K users
Languages   Python
🌐
Black
black.readthedocs.io
Black code formatter - Read the Docs
By using Black, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting.
Discussions

Adding black as linter?
I thoroughly enjoy working on projects where we never, ever have to debate style in PRs. A very effective way to achieve that is to use a formatter, such as black. Now, I know that black is somewhat controversial (because the code it produces isn’t always what we would have written). More on discuss.scientific-python.org
🌐 discuss.scientific-python.org
0
7
October 5, 2022
Is the damage psf/Black has done to the community reversible?
capable narrow wistful simplistic bells historical bright possessive disagreeable birds This post was mass deleted and anonymized with Redact More on reddit.com
🌐 r/Python
133
0
July 26, 2024
formatter - Doubts about black formatting in python - Stack Overflow
I'm configurating Visual Studio Code or Python programming, using PyLint as linter and Black as a formatter. I could configure for auto-formating when save but i was wondering if there is a way to ... More on stackoverflow.com
🌐 stackoverflow.com
We're the core team behind the popular Python autoformatter: Black. AMA!
You have made my life better. No question, just thank you! More on reddit.com
🌐 r/Python
210
747
September 11, 2021
🌐
PyPI
pypi.org › project › black
black · PyPI
Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting.
      » pip install black
    
Published   Mar 12, 2026
Version   26.3.1
🌐
Vercel
black.vercel.app
Black Playground
Playground for Black, the uncompromising Python code formatter.
🌐
DEV Community
dev.to › saminarp › write-clean-python-code-using-pylint-and-black-17e3
✨Write clean Python code using pylint and black ✨🐍 - DEV Community
November 5, 2022 - Search for 'python formatting provider' and then select 'black' from the drop down menu: After that search for 'format on save' and enable the "Editor: Format On Save" option · Now, everytime you save, the code will be automatically formatted.
🌐
Adafruit
learn.adafruit.com › improve-your-code-with-pylint › black
Black | Improve Your Code with Pylint and Black | Adafruit Learning System
August 23, 2019 - When you submit your code to the CircuitPython project, it's checked for syntax. You submit a pull request with your code and wait to see if the checks pass. Wouldn't it be nice to check your code BEFORE you submit it? You can! This guide will walk you through the steps to get Pylint and Black set up locally so you can lint your own code like a pro.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Black Formatter - Visual Studio Marketplace
Extension for Visual Studio Code - Formatting support for Python files using the Black formatter.
🌐
GitHub
github.com › astral-sh › ruff
GitHub - astral-sh/ruff: An extremely fast Python linter and code formatter, written in Rust. · GitHub
2 weeks ago - # Exclude a variety of commonly ignored directories. exclude = [ ".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg", ".ipynb_checkpoints", ".mypy_cache", ".nox", ".pants.d", ".pyenv", ".pytest_cache", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", ".vscode", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "site-packages", "venv", ] # Same as Black. line-length = 88 indent-width = 4 # Assume Python 3.10 target-version = "py310" [lint] # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
Starred by 46.7K users
Forked by 2K users
Languages   Rust 96.3% | Python 2.7% | TypeScript 0.9% | Shell 0.1% | CSS 0.0% | HTML 0.0%
Find elsewhere
🌐
Scientific Python
discuss.scientific-python.org › contributor & development discussion › scikit-image
Adding black as linter? - scikit-image - Scientific Python
October 5, 2022 - I thoroughly enjoy working on projects where we never, ever have to debate style in PRs. A very effective way to achieve that is to use a formatter, such as black. Now, I know that black is somewhat controversial (becau…
🌐
Astral
astral.sh › blog › the-ruff-formatter
The Ruff Formatter: An extremely fast, Black-compatible Python formatter
October 24, 2023 - It’s over 30x faster than Black and 100x faster than YAPF, formatting large-scale Python projects in milliseconds — all while achieving >99.9% Black compatibility. A little over a year ago, I made the first commit to Ruff, an extremely fast Python linter, written in Rust.
🌐
Read the Docs
black.readthedocs.io › en › stable
Black 26.3.0 documentation
By using Black, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting.
🌐
Pyrfecter
pyrfecter.com
Home · Pyrfecter
Visit the Black playground at https://black.vercel.app · Click the settings gear (⚙️) in the bottom left · Specify your new line length in the "Line Length" input · Wait for your code to be reformatted automatically · That's a good question. Pyrfecter was designed to be used to tidy ...
🌐
Reddit
reddit.com › r/python › is the damage psf/black has done to the community reversible?
r/Python on Reddit: Is the damage psf/Black has done to the community reversible?
July 26, 2024 -

I really don't understand why the Python Black formatter seems to be so popular. What is the point of a non-configurable and highly biased code formatter? I see no benefit in making all the code in the world look the same. They claim they are ending discussions about code formatting, but in reality they have sparked the biggest debate ever in the Python community with their subjective and often contradictory methods that have evolved over decades of established practices without the ability to configure the formatter. [1][2] The single/double quote disaster is just the most prominent example.

There are people out there who put readability above consistency with every other code base in the world that they will never come into contact with.

What bothers me most is the detachment of the Black developers, who dismiss all objections to their style choices as if they were opinions, and end every discussion by saying, you are just expressing an opinion and we prefer ours. But that is not true, there were many reasons, objectively measurable reasons, why this or that decision is better. Someone else might weigh these reasons differently and therefore come to a different conclusion. But the arguments used to enforce Black's decisions have never stood the test of time in a factual discussion.

I also notice that younger developers (< 35 years) are more likely to accept this approach than the more experienced ones.

[1] https://github.com/psf/black/issues/1252

[2] https://github.com/psf/black/issues/373

🌐
MegaLinter
megalinter.io › 7 › descriptors › python_black
black configuration in MegaLinter - MegaLinter by OX Security
This linter is available in the following flavours ... Usage: black [OPTIONS] SRC ... The uncompromising code formatter. Options: -c, --code TEXT Format the code passed in as a string. -l, --line-length INTEGER How many characters per line to allow. [default: 88] -t, --target-version [py33|py34|py35|py36|py37|py38|py39|py310|py311|py312|py313] Python ...
🌐
Medium
medium.com › @evaGachirwa › improving-python-code-quality-using-pylint-and-black-5094dbebc1b2
Improving python code quality using Pylint and Black | by Eva Mwangi | Medium
May 28, 2022 - Use black before pylint, you will love it!! Pylint is a bug and code quality checker in python. It acts as a bad reviewer who nitpicks your code, checking where you used + to concatenate strings instead of using fstrings. While it could be that simple it also suggests how a programmer handles errors, how they use try-catch operations etc.
🌐
Pyrfecter
pyrfecter.com › format-python-code
Format Python code online · Pyrfecter
June 26, 2025 - Using " in Python dicts rather than ' helps with JSON compatibility. Why not! It's free, easy, and secure because your code never leaves your browser. Pyrfecter uses Black to format your Python code.
🌐
freeCodeCamp
freecodecamp.org › news › auto-format-your-python-code-with-black
How to Auto-Format Your Python Code with Black
May 12, 2020 - You can use black sample_code.py in the terminal to change the format. After running Black, you will see the following output: Then you can open sample_code.py to see formatted python code:
🌐
Medium
manishankarjaiswal.medium.com › formatting-and-linting-python-code-with-isort-black-and-flake8-39bf876666ed
Formatting and Linting Python Code with isort, black, and flake8 | by Manishankar Jaiswal | Medium
January 15, 2025 - black is an uncompromising code formatter for Python. Its goal is to standardize formatting, eliminating debates over style choices. Opinionated and consistent: Adheres to PEP 8 by default.
🌐
Read the Docs
black.readthedocs.io › en › stable › the_black_code_style › current_style.html
The Black code style - Black 26.3.0 documentation
Black prefers parentheses over backslashes, and will remove backslashes if found. # in: if some_short_rule1 \ and some_short_rule2: ... # out: if some_short_rule1 and some_short_rule2: ... # in: if some_long_rule1 \ and some_long_rule2: ... # out: if ( some_long_rule1 and some_long_rule2 ): ... Backslashes and multiline strings are one of the two places in the Python grammar that break significant indentation.
🌐
Stack Overflow
stackoverflow.com › questions › 73927074 › doubts-about-black-formatting-in-python
formatter - Doubts about black formatting in python - Stack Overflow
I could configure for auto-formating when save but i was wondering if there is a way to "tell" black to use the variable name convention for PEP8... for example, if detects a constant to change automatically to upper case, if it's a variable that is in camel case that converts it to snake_case, etc.. ... { "python.linting.pycodestyleEnabled": true, "python.linting.pycodestyleArgs": [ "--max-line-length=90" ], "python.linting.pylintEnabled": true, "python.formatting.provider": "black", "[python]":{ "editor.formatOnSabe":true, }, "python.linting.enabled": true,