A Jupyter Notebook/Lab extension that automatically formats Python code using Black (or YAPF for older Python).
nb_black is a Jupyter extension that automatically formats Python code in notebook cells using the Black formatter (or YAPF for Python <3.6). It solves the problem of inconsistent or messy code styling in interactive Jupyter environments by applying standardized formatting on execution.
Data scientists, researchers, and developers who use Jupyter Notebook or Jupyter Lab for Python programming and want to maintain clean, PEP 8-compliant code without manual formatting.
It integrates Black's opinionated, zero-config formatting directly into Jupyter workflows, saving time and ensuring consistency where manual formatting is often overlooked.
A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using black.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Applies Black's formatting on cell execution to ensure code adheres to PEP 8 standards without manual intervention, improving readability in notebooks.
Can be loaded with a single %load_ext command in Jupyter Notebook or Jupyter Lab, as stated in the README, making integration straightforward.
Falls back to YAPF for Python versions below 3.6, allowing use in legacy projects where Black isn't supported.
Works seamlessly with both Jupyter Notebook and Jupyter Lab, covering the most common interactive Python development setups.
Formatting is suppressed if code is edited during cell execution, forcing users to stick with unformatted code in such cases, as noted in the README.
Uses YAPF for older Python versions, which has different formatting rules than Black, potentially leading to style discrepancies in mixed-version projects.
Relies on Black's opinionated approach with zero configuration, offering no flexibility to adjust formatting rules for team-specific preferences.