--- id: jupyter-black version: "0.4.0" license: MIT license_treatment: permissive maintenance: dormant --- # jupyter-black — A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using Black. Fork of dnanhkhoa/nb_black. License: permissive · Maintenance: dormant · Downloads: 137.4K/mo ## What it is and what it does jupyter-black is an extension that integrates the Black code formatter into your notebook workflow. Once loaded, it automatically formats any syntactically correct Python code cell with Black immediately after you run it, without requiring manual formatting steps. The extension reads Black configuration from pyproject.toml if available and allows you to override settings like line length and target Python version through its load function. It depends only on black as a runtime dependency and works with both Jupyter Notebook and JupyterLab (defaulting to lab mode). The extension can be loaded either through Python code with configuration options or via the %load_ext magic command, though the magic command defaults to lab=True and may not work in standalone notebook installations. Use it for: - Automatically format code cells to Black style without manual intervention after each cell execution. - Enforce consistent code formatting across a notebook-based project by loading the extension at startup. - Override Black defaults like line length and target Python version on a per-notebook basis using the configurable load function. - Migrate from nb_black while gaining access to newer Black features and improved responsiveness. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Jupyter Notebook and JupyterLab extension that automatically formats Python code cells using Black after they are run. Yes, if you use Jupyter Notebook or JupyterLab and want automatic Black formatting. The extension has low install friction, no security vulnerabilities, and a permissive MIT license. However, note that the project is dormant (last release 2024-08-30); if you need active maintenance or encounter compatibility issues with newer versions, you may need to pin versions or consider alternatives. ## Install pip install jupyter-black uv add jupyter-black poetry add jupyter-black ## Installing jupyter-black Before you install: Low install friction with a single runtime dependency on black. The project is dormant (last release 2024-08-30, 714 days ago) but the repository remains active and unarchived. No known vulnerabilities. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both personal and commercial projects. Quickstart: pip install jupyter-black # In a notebook cell: import jupyter_black jupyter_black.load() Requires Jupyter Notebook or JupyterLab to be installed and running; the extension only formats cells after they are executed. Verify before relying: - Whether the extension works with all current versions of Jupyter Notebook and JupyterLab, given the dormant maintenance status. - Compatibility with the latest versions of black beyond what the fact sheet documents. - Whether the extension requires specific Python versions beyond the classifiers listed (3.8, 3.9, 3.10, 3.11). ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 137.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags jupyter code formatter, black formatter jupyter, automatic code formatting notebook, jupyter lab extension formatting, python code beautifier jupyter, jupyter notebook black integration, auto-format jupyter cells, jupyter-extension, code-formatting, black-integration [View on SkillFed](https://skillfed.io/packages/jupyter-black) · [View on PyPI](https://pypi.org/project/jupyter-black/)