.. SPDX-FileCopyrightText: 2021 Veit Schiele .. .. SPDX-License-Identifier: BSD-3-Clause Black ===== `Black `_ formats your code in a nice and deterministic format. .. seealso:: What characterises readable code is well described in Trey Hunner's blog post `Craft Your Python Like Poetry `_. Installation ------------ .. code-block:: console $ uv add black Check ----- Then you can check the installation with .. code-block:: console $ uv run black /PATH/TO/YOUR/SOURCE/FILE Integration ----------- With `jupyter-black `_ you can already use Black in your Jupyter notebooks. .. seealso:: Integration into other editors such as PyCharm, Wing IDE or Vim is also possible, see `Editor integration `_ Configuration ------------- In contrast to Black’s standard 88-character formatting, however, I prefer a line length of 79 characters. For this you can enter the following in ``pyproject.toml``: .. code-block:: toml [tool.black] line-length = 79 .. seealso:: You can get more information about the configuration of Black in the Toml file in `pyproject.toml `_.