# Install black with Homebrew, apk, apt, dnf, Nix, winget

Python code formatter. Version 26.5.1 via Homebrew; verified 2026-06-09.

## Install

```sh
sudo av install brew:black
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install black
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add black
```

  Evidence: Alpine Linux edge package indexes: black from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install black
```

  Evidence: Debian stable package indexes: black from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install black
```

  Evidence: Fedora Rawhide package metadata: black from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#black
```

  Evidence: nixpkgs package indexes: black from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

### Windows

- winget (92%):

```sh
winget install --id psf.black -e
```

  Evidence: Windows Package Manager source index: psf.black from https://cdn.winget.microsoft.com/cache/source.msix

## Package facts

- **Package key:** brew:black
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/black>
- **Version:** 26.5.1
- **Source summary:** Python code formatter
- **Homepage:** <https://black.readthedocs.io/en/stable/>
- **Repository:** <https://github.com/psf/black>
- **Upstream docs:** <https://black.readthedocs.io/en/stable>
- **License:** MIT
- **Source archive:** <https://files.pythonhosted.org/packages/c0/37/5628dd55bf2b34257fc7603f0fe97c40e3aaf24265f416a9c85c95ca1436/black-26.5.1.tar.gz>
- **Last updated:** 2026-06-09T10:24:11Z
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- black (cli)
- blackd (cli)
- black (alias)
- blackd (alias)

## Dependencies

- python@3.14

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Service: declared
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 26.5.1
- Package-manager updated: 2026-06-09
- Local data: ok
- Upstream repository: https://black.readthedocs.io/en/stable/
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

Black is the opinionated Python code formatter whose promise is deterministic, low-choice formatting. It became one of the defining Python developer tools of the late 2010s and 2020s, normalizing gofmt-style formatting in Python projects.

### Project history

Black was first published to PyPI in March 2018 and its GitHub repository was created the same day. Its README and documentation present it as 'The Uncompromising Code Formatter': users trade manual formatting control for speed, determinism, smaller diffs, and fewer style arguments.

The project is now maintained under the Python Software Foundation GitHub organization. Its documentation codifies a stability policy, preview style, and yearly stable style cadence, allowing Black to support new Python syntax while preserving formatting predictability for established projects.

### Adoption history

Black spread rapidly through PyPI, pre-commit, CI, editor integrations, and Linux/macOS/Windows package managers. The README lists major projects and organizations using it, including pytest, Django, pandas, SQLAlchemy, Home Assistant, Zulip, Dropbox, Lyft, Mozilla, Quora, and others.

Its adoption changed Python package maintenance culture: many projects stopped debating PEP 8 edge cases in reviews and delegated whitespace, wrapping, quote normalization, and import-adjacent formatting decisions to a pinned formatter version.

### How it is used

The standard CLI workflow is black {source_file_or_directory}; Black reformats files in place and can also run as python -m black. Configuration normally lives in a project's pyproject.toml under [tool.black], with global fallback files at $XDG_CONFIG_HOME/black or ~/.config/black on Unix-like systems and ~/.black on Windows.

Black is commonly run from pre-commit hooks, GitHub Actions, editors, and CI jobs. Its documentation recommends the psf/black-pre-commit-mirror hook for version-control integration and warns that blackd does not use pyproject.toml configuration.

### Why package nerds care

Black is package-nerd significant because it made formatter pinning a first-class dependency-management concern in Python. A Black version in pyproject.toml, pre-commit config, CI images, or distro packages can affect every formatted file in a repository, so release notes and stability guarantees matter more than they do for many CLIs.

It also helped shift Python packaging metadata toward pyproject.toml as a shared control plane: the same file that PEP 518 introduced for builds became the obvious place to store Black's project style. Black's presence in Homebrew, Debian, Ubuntu, Fedora, Alpine, Nix, and winget mirrors its role as both Python package and general developer workstation tool.

For maintainers, Black became shorthand for removing a category of bikeshed from reviews. For downstream packagers, it is a high-visibility fast-moving Python application that must track supported Python versions, parser behavior, compiled wheels, pre-commit mirrors, and reproducible CLI behavior.

### Timeline

- 2018-03-14: Black 18.3a0 is uploaded to PyPI and the GitHub repository is created.
- 2019: The project gains broad public visibility through talks, docs, badges, and early adopter projects.
- 2022-01-29: Black 22.1.0 is published as the first non-alpha, stable-style release line.
- 2020s: Black becomes widely packaged across Homebrew, Linux distributions, Nix, and winget while remaining centered on PyPI and pre-commit workflows.
- 2024-2026: Black's changelog documents yearly stable-style releases and preview/unstable channels for future formatting changes.

### Related projects

- Black's README explicitly situates it near gofmt and lists autopep8 and YAPF among related Python formatters through repository topics.
- It is commonly paired with pre-commit, CI systems, editor integrations, and Python packaging metadata in pyproject.toml.

### Sources

- <https://black.readthedocs.io/en/stable>
- <https://black.readthedocs.io/en/stable/integrations/source_version_control.html>
- <https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy>
- <https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html>
- <https://github.com/psf/black#readme>
- <https://pypi.org/project/black/>
- source_facts.package-manager


## Security Notes

formula declares a Homebrew service.

- **Geiger risk:** orange / medium
- formula declares a Homebrew service


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: pyproject.toml, $XDG_CONFIG_HOME/black, ~/.config/black
- Windows: pyproject.toml, ~\.black
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** black
- **Version Scheme:** 0
- **Revision:** 1
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - black - 25.1.0-3+deb13u1: normalized package name match | Debian stable package indexes: black from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | uncompromising Python code formatter (Python 3) | https://github.com/psf/black
- Debian apt - python-black-doc - 25.1.0-3+deb13u1: normalized package name match | Debian stable package indexes: python-black-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | uncompromising Python code formatter (common documentation) | https://github.com/psf/black
- Nix - black: normalized package name match | nixpkgs package indexes: black from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - black - 24.2.0-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: black from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | uncompromising Python code formatter (Python 3) | https://github.com/psf/black
- Ubuntu apt - python-black-doc - 24.2.0-1ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: python-black-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | uncompromising Python code formatter (common documentation) | https://github.com/psf/black
- apk - black - 26.3.0-r1: normalized package name match | Alpine Linux edge package indexes: black from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | The uncompromising Python code formatter | https://github.com/psf/black
- apk - black-bash-completion - 26.3.0-r1: normalized package name match | Alpine Linux edge package indexes: black-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for black | https://github.com/psf/black
- apk - black-fish-completion - 26.3.0-r1: normalized package name match | Alpine Linux edge package indexes: black-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Fish completions for black | https://github.com/psf/black
- apk - black-pyc - 26.3.0-r1: normalized package name match | Alpine Linux edge package indexes: black-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for black | https://github.com/psf/black
- apk - black-zsh-completion - 26.3.0-r1: normalized package name match | Alpine Linux edge package indexes: black-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Zsh completions for black | https://github.com/psf/black
- dnf - black - 25.1.0-9.fc45: normalized package name match | Fedora Rawhide package metadata: black from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | The uncompromising code formatter | https://github.com/psf/black
- winget - psf.black: normalized package name match | Windows Package Manager source index: psf.black from https://cdn.winget.microsoft.com/cache/source.msix


## Related links

- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://www.automicvault.com/pkg/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [python@3.14](https://www.automicvault.com/pkg/brew/python-3-14/) - Runtime dependency declared by Homebrew.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [gersemi](https://www.automicvault.com/pkg/brew/gersemi/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.
- [djhtml](https://www.automicvault.com/pkg/brew/djhtml/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter, pre-commit.
- [isort](https://www.automicvault.com/pkg/brew/isort/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter, pre-commit.
- [darker](https://www.automicvault.com/pkg/brew/darker/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, formatter, python.
- [ktfmt](https://www.automicvault.com/pkg/brew/ktfmt/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.
- [reorder-python-imports](https://www.automicvault.com/pkg/brew/reorder-python-imports/) - Shares av.db curated category or tags: cli, code-formatting, developer-tools, pre-commit, python.
- [scalariform](https://www.automicvault.com/pkg/brew/scalariform/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.
- [swiftformat](https://www.automicvault.com/pkg/brew/swiftformat/) - Shares av.db curated category or tags: cli, code-formatting, code-style, developer-tools, formatter.

## Combined YAML source

View the package source record on GitHub. [combined/black.yml](https://github.com/automic-vault/db/blob/main/combined/black.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
