Skip to main content

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

Project description

nb_black-formatter

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-formatter

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

Uploaded Source

File details

Details for the file nb_black_formatter-1.0.1.tar.gz.

File metadata

  • Download URL: nb_black_formatter-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for nb_black_formatter-1.0.1.tar.gz
Algorithm Hash digest
SHA256 24153ab7e381cec202319ef0087ac0ae85a161d1e8e30f53c246d4782b9d4d40
MD5 e7bd49be92dab759fbbfbbfc2a7feafa
BLAKE2b-256 746cf05248450ee5dd4c20829ccc655781a23269e3992d5878605e6d7c8fb224

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