{"library":"nbqa","title":"nbqa: Run Code Quality Tools on Jupyter Notebooks","description":"nbqa is a command-line tool that allows you to run any standard Python code quality tool on Jupyter Notebooks. It robustly handles IPython magics, respects your existing configuration files (like `pyproject.toml`), and can lint both code and markdown cells. The current version is 1.9.1, with frequent minor point releases.","language":"python","status":"active","last_verified":"Tue Apr 14","install":{"commands":["pip install nbqa","pip install -U \"nbqa[toolchain]\""],"cli":{"name":"nbqa","version":"nbqa 1.9.1"}},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# Install nbqa and a code quality tool (e.g., black)\npip install -U nbqa black\n\n# Create a dummy notebook (e.g., my_notebook.ipynb)\necho '{\n \"cells\": [\n  {\n   \"cell_type\": \"code\",\n   \"execution_count\": null,\n   \"metadata\": {},\n   \"outputs\": [],\n   \"source\": [\"import os\\n\\nx =  1 +  2\"]\n  }\n ],\n \"metadata\": {\n  \"kernelspec\": {\n   \"display_name\": \"Python 3\",\n   \"language\": \"python\",\n   \"name\": \"python3\"\n  },\n  \"language_info\": {\n   \"codemirror_mode\": {\n    \"name\": \"ipython\",\n    \"version\": 3\n   },\n   \"file_extension\": \".py\",\n   \"mimetype\": \"text/x-python\",\n   \"name\": \"python\",\n   \"nbconvert_exporter\": \"python\",\n   \"pygments_lexer\": \"ipython3\",\n   \"version\": \"3.9.0\"\n  }\n },\n \"nbformat\": 4,\n \"nbformat_minor\": 4\n}' > my_notebook.ipynb\n\n# Run black on the notebook using nbqa\nnbqa black my_notebook.ipynb\n\n# Expected output will show reformatting, e.g.:\n# reformatted my_notebook.ipynb\n# All done! ✨ 🍰 ✨ 1 file reformatted.\n\n# To verify changes (if you open the notebook, it should be formatted)\n# cat my_notebook.ipynb","lang":"bash","description":"This quickstart demonstrates how to install `nbqa` and `black`, then use `nbqa` to format a Jupyter Notebook. Remember to install the specific code quality tools (like `black`, `flake8`, `isort`) you wish to use alongside `nbqa`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}