Skip to main content

A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using Black. This version only supports black and stripts yapf support. Based on https://github.com/dnanhkhoa/nb_black

Project description

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 the Black package only supports Python 3.6+. 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. :)

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_only-1.0.9.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file nb_black_only-1.0.9.tar.gz.

File metadata

  • Download URL: nb_black_only-1.0.9.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for nb_black_only-1.0.9.tar.gz
Algorithm Hash digest
SHA256 7a261bb8f851cc9e7f330965015e33b2dde12c178b32b2fff04486a801929aa4
MD5 f0c68e26a05b160ec0b82c2513db5c51
BLAKE2b-256 497f4d951ee4402f76e70b24583af5b9ea7f937e0c0f92de57ece46c066648aa

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