{"library":"myst-nb","title":"MyST-NB","description":"MyST-NB is a Sphinx extension that enables direct parsing and execution of Jupyter Notebooks (.ipynb) within Sphinx documentation. It builds upon the MyST Markdown parser, allowing users to write rich technical documentation that seamlessly integrates executable code, outputs, and MyST Markdown syntax. The library maintains an active development cycle, with new versions released regularly to enhance features and ensure compatibility with the latest Python and Sphinx versions.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install myst-nb"],"cli":null},"imports":["extensions = ['myst_nb'] # in conf.py","from myst_nb import glue"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\n\n# --- conf.py (Sphinx configuration file) ---\n# project = 'MyST-NB Quickstart'\n# copyright = '2026, Your Name'\n# extensions = [\n#     'myst_nb',\n#     'sphinx.ext.autodoc', # Example standard Sphinx extension\n# ]\n# # Optional: Configure notebook execution\n# # nb_execution_mode = \"auto\" # 'auto', 'off', 'force', 'cache'\n# # nb_execution_timeout = 60\n\n# --- example.md (MyST Markdown file with code cells) ---\nexample_md_content = '''\n# MyST-NB Example Document\n\nThis is a MyST Markdown file demonstrating executable code cells.\n\n```{code-cell} python\nimport datetime\nprint(\"Hello from MyST-NB!\")\nprint(f\"Current time: {datetime.datetime.now()}\")\n```\n\nYou can also use the `glue` functionality to embed variables from executed cells.\n\n```{code-cell} python\nfrom myst_nb import glue\nmy_result = \"This value was 'glued' from a Python cell.\"\nglue(\"my_embedded_string\", my_result)\n```\n\nThe result embedded from the code cell is: {glue:text}`my_embedded_string`.\n'''\n\n# To run this, you would typically:\n# 1. Create a Sphinx project (e.g., `sphinx-quickstart`)\n# 2. Modify `conf.py` as commented above\n# 3. Create `example.md` with the content above\n# 4. Build with `sphinx-build -b html . _build`\n\n# This snippet simulates saving the content to files for demonstration.\n# In a real Sphinx project, these files would exist in your source directory.\n# (Not actually running sphinx-build here, just showing file content)\nprint(\"--- Simulated conf.py content ---\")\nprint(\"# See comments in code for full conf.py example\")\nprint(\"extensions = ['myst_nb']\")\n\nprint(\"\\n--- Simulated example.md content ---\")\nprint(example_md_content)\n","lang":"python","description":"To quickly get started, install MyST-NB and add 'myst_nb' to the `extensions` list in your Sphinx `conf.py`. You can then create MyST Markdown files (`.md`) or Jupyter Notebooks (`.ipynb`) containing code cells, which MyST-NB will parse and execute during the Sphinx build process. The `glue` function allows embedding variables directly into your narrative text.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"1.3.0","pypi_latest":"1.4.0","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":14.2,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"221.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":14.5,"import_time_s":null,"mem_mb":null,"disk_size":"203M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"239.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":14.7,"import_time_s":null,"mem_mb":null,"disk_size":"222M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"227.9M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":12.8,"import_time_s":null,"mem_mb":null,"disk_size":"213M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"227.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":12.9,"import_time_s":null,"mem_mb":null,"disk_size":"213M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"195.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"myst-nb","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":15.9,"import_time_s":null,"mem_mb":null,"disk_size":"179M"}]}}