{"id":24103,"library":"nbtoolbelt","title":"nbtoolbelt","description":"nbtoolbelt (version 2024.7.2) provides tools to work with Jupyter notebooks programmatically. It supports tasks like merging, splitting, executing, and converting notebooks. Released as a companion to jupyter-releaser, with regular updates.","status":"active","version":"2024.7.2","language":"python","source_language":"en","source_url":"https://github.com/jupyter/nbtoolbelt","tags":["jupyter","notebook","toolbelt","merge","convert"],"install":[{"cmd":"pip install nbtoolbelt","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Notebook is a top-level export; submodule import may fail.","wrong":"from nbtoolbelt.notebook import Notebook","symbol":"Notebook","correct":"from nbtoolbelt import Notebook"},{"note":"","symbol":"merge_notebooks","correct":"from nbtoolbelt import merge_notebooks"}],"quickstart":{"code":"from nbtoolbelt import Notebook\n\nnb = Notebook.from_path('example.ipynb')\nprint(nb.cells[0].source)","lang":"python","description":"Load a Jupyter notebook and print the source of the first cell."},"warnings":[{"fix":"Pin to a specific major version range in requirements.txt.","message":"The library uses calendar versioning (YYYY.MM.MICRO). Major changes can occur between minor versions; pin your dependency (nbtoolbelt>=2024.7,<2025) to avoid unexpected breaks.","severity":"breaking","affected_versions":"all"},{"fix":"Wrap in try/except or validate JSON beforehand.","message":"Notebook.from_path() does not verify the notebook file is valid JSON. Invalid notebooks cause cryptic errors during cell access.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to nbtoolbelt's Notebook API.","message":"The old API using nbformat as a dependency directly may be removed. Use Notebook objects instead.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install nbtoolbelt --upgrade` and verify import: `from nbtoolbelt import Notebook`.","cause":"nbtoolbelt was installed incorrectly or a different package with same name is installed.","error":"AttributeError: module 'nbtoolbelt' has no attribute 'Notebook'"},{"fix":"Install with `pip install nbtoolbelt` and ensure your environment is correct.","cause":"Package not installed or virtual environment not activated.","error":"ModuleNotFoundError: No module named 'nbtoolbelt'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}