November 29, 2021    Share on: Twitter | Facebook | HackerNews | Reddit

Black code formatter

Black is non-configurable code formatter.

Install black for jupyter notebook

jupyter nbextension install https://github.com/drillan/jupyter-black/archive/master.zip --user
jupyter nbextension enable jupyter-black-master/jupyter-black

Change the line length character limit in Black

To change the character limit for the Black Python formatter, you can add following section to pyproject.toml file:

[tool.black]
line-length = 119

Usages of black

  • with tox
  • in pre-commit hooks
  • as external tool in PyCharm



Tags:  black python pyqa