• Stars
    star
    351
  • Rank 120,906 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using black.

nb_black

PyPI PyPI - Python Version

A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using Black.

Please note that since the Black package only supports Python 3.6+, so YAPF package will be used for the lower versions. If you edit the code while running the cell, the formatting is not submitted to the Jupyter notebook and instead silently suppressed, so you have to stick with the edited, but unformatted code.

Installation

You can install this package using pip:

$ [sudo] pip install nb_black

Usage

For Jupyter Notebook:

%load_ext nb_black

For Jupyter Lab:

%load_ext lab_black

Just put this code into the first cell in your Notebook, and that's all. :)