Black
github.com
4
Leaving SiteNav
External Link Disclaimer
You are about to visit github.com. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Black is the uncompromising Python code formatter, developed and maintained by the Python Software Foundation (PSF). Created by Lukasz Langa (a CPython core developer), Black takes a radically different approach to code formatting: instead of providing dozens of configuration options for customizing how code looks, Black enforces a single, opinionated formatting style with minimal configuration. This philosophy has made Black one of the most popular Python development tools, adopted by major projects including Django, Flask, FastAPI, CPython itself, pandas, and thousands of other open-source and commercial codebases. The core value proposition is eliminating bikeshedding about code style: when every developer on a team uses Black, all code looks identical, reducing cognitive load during code reviews and eliminating style-related discussions entirely. Black reformats entire files in place, ensuring consistent formatting across the entire codebase. Key features include: automatic string quote normalization (converting all string literals to use double quotes unless the string itself contains double quotes), line length optimization (targeting a configurable maximum line length, defaulting to 88 characters, and wrapping long lines intelligently), trailing comma handling (adding or removing trailing commas in collections based on whether the collection spans multiple lines), removal of unnecessary parentheses, whitespace normalization around operators and in function signatures, automatic handling of magic trailing commas (if a collection has a trailing comma on the last element, Black will keep it expanded across multiple lines), Python 3.8+ support including positional-only parameters and walrus operator formatting, Jupyter Notebook formatting support (formatting code cells in Jupyter notebooks), and integration with all major editors (VS Code, PyCharm, Neovim, Emacs, Sublime Text) and pre-commit hooks. As of 2026, Black has over 40,000 stars.
Statistics
4
Views
0
Clicks
0
Like
0
Dislike