Skip to main content

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

Project description

# nb_black

[![PyPI](https://img.shields.io/pypi/v/nb_black.svg)]() [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nb_black.svg)]()

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](http://www.pip-installer.org):

` $ [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. :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for nb-black, version 1.0.7
Filename, size File type Python version Upload date Hashes
Filename, size nb_black-1.0.7.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page