{
  "name": "Routes for converting a Jupyter notebook to a Python script",
  "description": "Compares four documented routes for turning an .ipynb notebook into a Python script: the nbconvert script and python exporters, the JupyterLab export menu and Jupytext pairing. Each row gives the command or menu entry, the direction of conversion and the tool that provides it, compiled from the nbconvert, JupyterLab and Jupytext documentation read on 2026-11-17.",
  "page": "https://casrai.org/guides/convert-jupyter-notebook-to-python",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-26T10:25:00Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Route",
      "unit": "",
      "description": ""
    },
    {
      "name": "Command or menu entry",
      "unit": "",
      "description": ""
    },
    {
      "name": "Direction",
      "unit": "",
      "description": ""
    },
    {
      "name": "Provided by",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Route": "nbconvert script exporter",
      "Command or menu entry": "jupyter nbconvert --to script notebook.ipynb",
      "Direction": "Notebook to script",
      "Provided by": "nbconvert"
    },
    {
      "Route": "nbconvert Python exporter",
      "Command or menu entry": "jupyter nbconvert --to python notebook.ipynb",
      "Direction": "Notebook to Python file",
      "Provided by": "nbconvert"
    },
    {
      "Route": "JupyterLab export",
      "Command or menu entry": "File menu, Executable Script (.py)",
      "Direction": "Notebook to script",
      "Provided by": "JupyterLab, via nbconvert"
    },
    {
      "Route": "Jupytext pairing",
      "Command or menu entry": "jupytext --set-formats ipynb,py:percent notebook.ipynb",
      "Direction": "Notebook and script paired",
      "Provided by": "Jupytext"
    }
  ],
  "sources": [
    {
      "title": "Using nbconvert",
      "url": "https://nbconvert.readthedocs.io/en/latest/usage.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "nbconvert Exporters API",
      "url": "https://nbconvert.readthedocs.io/en/latest/api/exporters.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "JupyterLab Exporting Notebooks",
      "url": "https://jupyterlab.readthedocs.io/en/stable/user/export.html",
      "accessed": "2026-11-17"
    },
    {
      "title": "jupytext on PyPI",
      "url": "https://pypi.org/project/jupytext/",
      "accessed": "2026-11-17"
    }
  ]
}