@deepnote/convert
Bidirectional converter between Deepnote project files (.deepnote) and multiple notebook formats: Jupyter (.ipynb), Quarto (.qmd), Percent (.py), and Marimo (.py).
npx @deepnote/convert notebook.ipynb
npx @deepnote/convert document.qmd
npx @deepnote/convert notebook.py
npx @deepnote/convert project.deepnote
npx @deepnote/convert project.deepnote --outputFormat quarto
npx @deepnote/convert project.deepnote --outputFormat percent
npx @deepnote/convert project.deepnote --outputFormat marimo
Installation
npm install -g @deepnote/convert
Supported Formats
| Jupyter | .ipynb | Standard Jupyter Notebook JSON format |
| Quarto | .qmd | Quarto markdown documents with code chunks |
| Percent | .py | Python files with # %% cell markers (VS Code, Spyder) |
| Marimo | .py | Marimo reactive notebooks with @app.cell decorators |
CLI Usage
The package provides a deepnote-convert command-line tool for bidirectional conversion.
Convert to Deepnote
Any supported format converts to .deepnote automatically:
deepnote-convert notebook.ipynb
deepnote-convert document.qmd
deepnote-convert notebook.py
deepnote-convert path/to/notebooks/
Convert from Deepnote
Use --outputFormat to choose the target format (defaults to jupyter):
deepnote-convert project.deepnote
deepnote-convert project.deepnote --outputFormat jupyter
deepnote-convert project.deepnote --outputFormat quarto
deepnote-convert project.deepnote --outputFormat percent
deepnote-convert project.deepnote --outputFormat marimo
Options
--projectName <name>
Set a custom name for the Deepnote project (when converting to .deepnote):
deepnote-convert notebook.ipynb --projectName "My Analysis"
-o, --outputPath <path>
Specify where to save the output:
deepnote-convert notebook.ipynb -o output/project.deepnote
deepnote-convert notebook.ipynb -o output/
deepnote-convert project.deepnote -o output/notebooks/
--outputFormat <format>
Choose output format when converting from .deepnote:
deepnote-convert project.deepnote --outputFormat quarto
Options: jupyter (default), quarto, percent, marimo
Examples
deepnote-convert titanic.ipynb --projectName "Titanic Analysis"
deepnote-convert ./notebooks -o ./output
deepnote-convert analysis.qmd --projectName "Data Report"
deepnote-convert script.py
deepnote-convert reactive.py
deepnote-convert project.deepnote
deepnote-convert project.deepnote --outputFormat quarto
deepnote-convert project.deepnote --outputFormat percent
deepnote-convert project.deepnote --outputFormat marimo
Python File Detection
When converting .py files, the converter auto-detects the format:
- Marimo: Contains
import marimo and @app.cell decorators
- Percent: Contains
# %% cell markers
For directory scanning, use explicit naming:
*.marimo.py for Marimo files
*.percent.py for percent format files
Lossless Roundtrip Conversion
The converter supports lossless roundtrip conversions for Jupyter:
- Deepnote → Jupyter → Deepnote: Preserves all Deepnote-specific metadata in Jupyter cell metadata
- Jupyter → Deepnote → Jupyter: Preserves original Jupyter content while adding Deepnote metadata
Other formats (Quarto, Percent, Marimo) preserve content and structure but may not retain all Deepnote-specific metadata.
Platform Compatibility
Since Jupyter (.ipynb) is the standard format, notebooks from cloud platforms that use Jupyter are fully supported with metadata preservation:
| Google Colab | ✅ Fully compatible | Preserves Colab cell IDs, form cells, GPU settings |
| Amazon SageMaker | ✅ Fully compatible | Preserves tags, training/inference markers |
| Kaggle | ✅ Fully compatible | Preserves UUIDs, cell GUIDs, hide input/output |
| Azure ML Notebooks | ✅ Fully compatible | Standard Jupyter with Azure metadata |
| JupyterLab/Hub | ✅ Fully compatible | Standard Jupyter format |
Platform-specific cell metadata is preserved during roundtrip conversion, allowing notebooks to be edited in Deepnote and exported back to the original platform without losing settings.
Programmatic Usage
Convert to Deepnote
import {
convertIpynbFilesToDeepnoteFile,
convertQuartoFilesToDeepnoteFile,
convertPercentFilesToDeepnoteFile,
convertMarimoFilesToDeepnoteFile,
} from "@deepnote/convert";
await convertIpynbFilesToDeepnoteFile(["notebook.ipynb"], {
outputPath: "output.deepnote",
projectName: "My Project",
});
await convertQuartoFilesToDeepnoteFile(["document.qmd"], {
outputPath: "output.deepnote",
projectName: "My Project",
});
await convertPercentFilesToDeepnoteFile(["script.py"], {
outputPath: "output.deepnote",
projectName: "My Project",
});
await convertMarimoFilesToDeepnoteFile(["notebook.py"], {
outputPath: "output.deepnote",
projectName: "My Project",
});
Convert from Deepnote
import {
convertDeepnoteFileToJupyterFiles,
convertDeepnoteFileToQuartoFiles,
convertDeepnoteFileToPercentFiles,
convertDeepnoteFileToMarimoFiles,
} from "@deepnote/convert";
await convertDeepnoteFileToJupyterFiles("project.deepnote", {
outputDir: "./jupyter-notebooks",
});
await convertDeepnoteFileToQuartoFiles("project.deepnote", {
outputDir: "./quarto-docs",
});
await convertDeepnoteFileToPercentFiles("project.deepnote", {
outputDir: "./percent-scripts",
});
await convertDeepnoteFileToMarimoFiles("project.deepnote", {
outputDir: "./marimo-notebooks",
});
Pure Conversion (No File I/O)
For programmatic use with in-memory data:
import fs from "node:fs/promises";
import { deserializeDeepnoteFile } from "@deepnote/blocks";
import {
convertDeepnoteToJupyterNotebooks,
convertDeepnoteToQuartoDocuments,
convertDeepnoteToPercentNotebooks,
convertDeepnoteToMarimoApps,
} from "@deepnote/convert";
const yamlContent = await fs.readFile("project.deepnote", "utf-8");
const deepnoteFile = deserializeDeepnoteFile(yamlContent);
const jupyterNotebooks = convertDeepnoteToJupyterNotebooks(deepnoteFile);
const quartoDocuments = convertDeepnoteToQuartoDocuments(deepnoteFile);
const percentNotebooks = convertDeepnoteToPercentNotebooks(deepnoteFile);
const marimoApps = convertDeepnoteToMarimoApps(deepnoteFile);
for (const { filename, notebook } of jupyterNotebooks) {
console.log(`${filename}: ${notebook.cells.length} cells`);
}
License
Apache-2.0