nbqa
Run any standard Python code quality tool on a Jupyter Notebook
Decision gist · record as of 2026-08-14
Yes. nbqa solves a genuine problem—applying code quality tools to notebooks—with low install friction, active maintenance, no known vulnerabilities, and a permissive license. It is widely used in production projects and integrates cleanly into CI/CD and pre-commit workflows. Install it if your team uses Jupyter notebooks and wants to enforce the same code standards as your .py files.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Individual linters (black, isort, mypy, etc.) must be installed separately or via the optional 'toolchain' extra.
- Low friction install with four runtime dependencies (autopep8, ipython, tokenize-rt, tomli).
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—only requiring license attribution.
last release 2024-11-10 (642 days) · last repo commit 2026-08-10 · 1,203 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 673,313 downloads/mo, #5,397 on PyPI
Alternatives
Verify before relying
pip install nbqa
nbqa black my_notebook.ipynb
nbqa isort my_notebook.ipynb --float-to-top
nbqa mypy my_notebook.ipynb- Whether the package works with all versions of Jupyter/IPython or has specific compatibility constraints beyond Python 3.9.
- Performance characteristics when processing large notebooks or running multiple linters in sequence.
- Whether markdown cell linting requires additional dependencies beyond those listed.
What it is and what it does
nbqa is a bridge that lets you run any standard Python code quality tool directly on Jupyter Notebooks. Instead of extracting code manually or writing custom scripts, you point nbqa at a notebook and a linter—black, isort, mypy, pylint, flake8, pyupgrade, ruff, or others—and it handles the notebook format transparently. It extracts code cells, runs the tool, and writes changes back while preserving the notebook structure.
The package is designed for teams that treat notebooks as production code and want to enforce the same style and quality standards across both .py files and .ipynb files. It respects your existing tool configuration files, handles IPython magics robustly so they don't break linting, preserves trailing semicolons in quiet mode, and can lint both code and markdown cells. It also works with .md files saved via Jupytext.
Use it for
- Enforce consistent code style (black, autopep8) across all notebooks in a data science project without manual reformatting.
- Run type checking (mypy) or linting (pylint, ruff) on notebook code to catch bugs before they reach production.
- Upgrade Python syntax (pyupgrade) and sort imports (isort) across a collection of notebooks as part of CI/CD.
- Set up pre-commit hooks to automatically format and lint notebooks before they are committed to version control.
- Lint markdown documentation cells in notebooks to maintain consistent documentation formatting.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
nbqa solves a genuine problem—applying code quality tools to notebooks—with low install friction, active maintenance, no known vulnerabilities, and a permissive license. It is widely used in production projects and integrates cleanly into CI/CD and pre-commit workflows. Install it if your team uses Jupyter notebooks and wants to enforce the same code standards as your .py files.
Install
nbqa on PyPI
Before you install
Low friction install with four runtime dependencies (autopep8, ipython, tokenize-rt, tomli). The project is actively maintained with a recent commit on 2026-08-10 and 1203 repository stars, indicating stable ongoing development.
Requires Python 3.9 or later. Individual linters (black, isort, mypy, etc.) must be installed separately or via the optional 'toolchain' extra.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions—only requiring license attribution.
Quickstart
pip install nbqa
nbqa black my_notebook.ipynb
nbqa isort my_notebook.ipynb --float-to-top
nbqa mypy my_notebook.ipynb
Verify before relying
- Whether the package works with all versions of Jupyter/IPython or has specific compatibility constraints beyond Python 3.9.
- Performance characteristics when processing large notebooks or running multiple linters in sequence.
- Whether markdown cell linting requires additional dependencies beyond those listed.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesautopep8ipythontokenize-rttomli |
| Maintenance | Actively maintained 642 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 673,313 / month, #5,397 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleFramework :: JupyterIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyTopic :: Software Development :: Quality Assurance |
Evidence: nbqa-1.9.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “jupyter notebook linting”
- nbqaRuns standard Python linters and formatters (ruff, black, isort,…
- jupyter-lspBridges Language Server Protocol servers to Jupyter Notebook and Lab…
- nbclassicProvides the classic Jupyter Notebook interface as a Jupyter Server…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also nbval · jupytext · nb-clean · darker · nbstripout · jupyterlab-code-formatter · pysen · nbtoolbelt · ipytest