Skip to content
A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using black.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Aug 20, 2018
LICENSE Initial commit Aug 20, 2018
MANIFEST.in Include the LICENSE in the sdist May 2, 2019
README.md Resolved #1 Dec 22, 2018
lab_black.py Fixed #4 May 11, 2019
nb_black.py Fixed #4 May 11, 2019
setup.cfg Add setup.cfg with license_file May 3, 2019
setup.py Fixed #4 May 11, 2019

README.md

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. And please DO NOT EDIT your code while running cell, otherwise your new code will be replaced by the formatted 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. :)

You can’t perform that action at this time.