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.

Source Distribution

nb_black-1.0.7.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file nb_black-1.0.7.tar.gz.

File metadata

  • Download URL: nb_black-1.0.7.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8

File hashes

Hashes for nb_black-1.0.7.tar.gz
Algorithm Hash digest
SHA256 1ca52e3a46675f6a0a6d79ac73a1f8f951bef60f919eced56173e76ab1b6d62b
MD5 9b86752d9091347527da2d5bc56fc0d3
BLAKE2b-256 a986195e7b1bcafe86c2f5deb3efcbdc6ab35f7269fc4b0095b94321de2215a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page