notebook_as_script
Convert a Jupyter notebook into a single Python script string with # %% cell markers for analysis, diffing, or programmatic use.
Instructions
Return the entire notebook as a single Python script string.
Each cell is preceded by a # %% marker (the convention used by VSCode, Spyder, and nbconvert) so the script can be analysed, diffed, or reasoned about as a complete program.
Code cells: source pasted verbatim under their marker.
Markdown cells: each line prefixed with "# " under their marker. Omitted entirely when include_markdown=False.
Raw cells: always skipped.
The script is returned in the response; no file is written to disk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| include_markdown | No |