Skip to main content

Format code cells in Jupyter Notebook and JupyterLab using black.

Project description


continuous-integration Python 3.8+ Checked with mypy pylint Score Code style: black Dependabot Status


Licence CodeSize

Format code cells in Jupyter Notebook and JupyterLab using Black.

It's as simple as calling jblack

$ jblack notebook.ipynb

Install jupyterblack from the command line with pip

$ pip install jupyterblack


# Format one Jupyter file:
$ jblack notebook.ipynb

# Format multiple Jupyter files:
$ jblack notebook_1.ipynb notebook_2.ipynb [...]

# Format a directory:
$ jblack python/

# Format one Jupyter file with a line length of 70:
$ jblack -l 70 notebook.ipynb

# Show help:
$ jblack -h


positional arguments:

optional arguments:
  -h, --help            show this help message and exit
  -l LINE_LENGTH, --line-length LINE_LENGTH
  -s, --skip-string-normalization
  -w WORKERS, --workers WORKERS
                        number of worker processes
  -t {py27,py33,py34,py35,py36,py37,py38} [{py27,py33,py34,py35,py36,py37,py38} ...], --target-version {py27,py33,py34,py35,py36,py37,py38} [{py27,py33,py34,py35,py36,py37,py38} ...]



If you are having issues or would like to propose a new feature, please use the issues tracker.


The project is licensed under the MIT license.

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 jupyterblack, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size jupyterblack-0.3.2-py3-none-any.whl (10.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size jupyterblack-0.3.2.tar.gz (9.3 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