{"id":21314,"library":"execnb","title":"execnb","description":"A Python library for executing Jupyter notebooks in non-interactive environments. Supports capturing outputs, rendering inline plots, and running notebooks from the command line. Current version 0.2.2, released March 2024. Maintained by AnswerDotAI, release cadence irregular.","status":"active","version":"0.2.2","language":"python","source_language":"en","source_url":"https://github.com/AnswerDotAI/execnb/","tags":["notebook","execution","jupyter","nbio","automation"],"install":[{"cmd":"pip install execnb","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Required for nbio module (moved from execnb in v0.2.0)","package":"fastcore","optional":false},{"reason":"Used for execution kernel and rich output","package":"ipython","optional":false},{"reason":"Inline plotting support (optional if mpl_format=None)","package":"matplotlib","optional":true}],"imports":[{"wrong":"from execnb import exec_nb","symbol":"exec_nb","correct":"from execnb import exec_nb"}],"quickstart":{"code":"from execnb.nbio import exec_nb\nfrom pathlib import Path\n\n# Execute a notebook and capture outputs\nnb = exec_nb('notebook.ipynb')\nfor cell in nb.cells:\n    if cell.outputs:\n        for output in cell.outputs:\n            print(output.text if hasattr(output, 'text') else output)","lang":"python","description":"Execute a Jupyter notebook file and iterate over cell outputs."},"warnings":[{"fix":"Update imports to use execnb.nbio for exec_nb, read_nb, NBIO. If using fastcore.nbio directly, adjust accordingly.","message":"The nbio module was moved from execnb.nbio to fastcore.nbio in version 0.2.0. Code using old imports will break.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Use mpl_format=None in exec_nb to skip matplotlib setup when not needed.","message":"The old exec_nb function without specifying mpl_format may set up inline matplotlib automatically, which can interfere with headless environments.","severity":"deprecated","affected_versions":"<0.2.2"},{"fix":"Ensure notebooks are prepared for batch execution, avoiding input() calls or interactive widgets.","message":"Executing notebooks that use interactive widgets or require user input will fail. execnb is designed for non-interactive execution.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to >=0.1.17 or manually set cell IDs in the notebook metadata.","message":"Cell IDs are not extracted from cell metadata automatically in versions prior to 0.1.17. This can cause duplicate or missing cell identifiers.","severity":"gotcha","affected_versions":"<0.1.17"}],"env_vars":null,"search_vec":"'0.2.2':29 '2024':32 'answerdotai':35 'autom':43 'cadenc':37 'captur':15 'command':25 'current':27 'environ':13 'execnb':1 'execut':6,40 'inlin':18 'interact':12 'irregular':38 'jupyt':7,41 'librari':4 'line':26 'maintain':33 'march':31 'nbio':42 'non':11 'non-interact':10 'notebook':8,22,39 'output':16 'plot':19 'python':3 'releas':30,36 'render':17 'run':21 'support':14 'version':28","created_at":"2026-04-27T16:59:14.332177+00:00","updated_at":"2026-04-27T16:59:14.332177+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'exec_nb' from 'execnb' (/tmp/tmp2bocz4f7/venv/lib/python3.12/site-packages/execnb/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.2.2","cli_name":"execnb","cli_version":"sh: 1: execnb: not found","type":"library","homepage":null,"github":"https://github.com/AnswerDotAI/execnb","docs":"https://AnswerDotAI.github.io/execnb/","changelog":null,"pypi":"https://pypi.org/project/execnb/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","devops","workflow"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}