| title | Converting Jupyter notebooks to Deepnote format |
|---|---|
| description | Learn how to convert Jupyter Notebook files (`.ipynb`) to Deepnote project files (`.deepnote`) using the `@deepnote/convert` tool. |
| noIndex | false |
| noContent | false |
This guide explains how to convert Jupyter Notebook files (.ipynb) to Deepnote project files (.deepnote) using the @deepnote/convert tool and how to convert Deepnote projects back to Jupyter notebooks via deepnote.com.
The @deepnote/convert package provides a command-line tool and programmatic API for converting between Jupyter notebooks and Deepnote's open-source format. This allows you to:
- Migrate existing Jupyter notebooks to Deepnote format
- Convert single notebooks or entire directories
- Preserve code, markdown, outputs, and execution counts
- Create multi-notebook Deepnote projects
- Convert Deepnote projects back to Jupyter notebooks via deepnote.com
How to install @deepnote/convert
Install the tool globally to use the deepnote-convert command from anywhere:
npm install -g @deepnote/convertAfter converting your notebooks, you can open them either in Deepnote or directly in your IDE (VS Code, Cursor, or Windsurf).
Option 1: Open directly in Deepnote
- Load the
.deepnotefile in the Deepnote application. - Configure the environment — install required Python packages and set environment variables.
- Run the notebook in Deepnote Cloud to collaborate in real time, build data apps, and enhance your workflow with AI tools.
Option 2: Open in your IDE
- Open the
.deepnotefile in VS Code, Cursor, or Windsurf. - Install the official Deepnote extension:
- To move your project to the cloud for collaboration or app creation:
- Press Cmd+Shift+P (macOS) or Ctrl+Shift+P (Windows/Linux)
- Type “Deepnote: Open in Deepnote”
- This creates a new Deepnote project ready to use
- Node.js: Version 20 or higher
The package provides a deepnote-convert command-line tool for converting notebooks.
Convert a single .ipynb file to a .deepnote file:
deepnote-convert path/to/notebook.ipynbThis creates a notebook.deepnote file in the current directory containing a single-notebook project.
Example:
deepnote-convert analysis.ipynb
# Creates: analysis.deepnoteConvert all .ipynb files in a directory to a single .deepnote project:
deepnote-convert path/to/notebooks/This creates a multi-notebook project where each .ipynb file becomes a separate notebook within the project.
Example:
deepnote-convert ./ml-experiments
# Creates: ml-experiments.deepnote (containing all notebooks from the directory)Upload .deepnote file to deepnote.com and download as .ipynb file.
Set a custom name for the Deepnote project:
deepnote-convert notebook.ipynb --projectName "My Analysis"If not specified, the project name defaults to:
- The filename (without extension) for single files
- The directory name for directories
Specify where to save the output .deepnote file:
# Save to a specific file
deepnote-convert notebook.ipynb -o output/project.deepnote
# Save to a directory (filename will be auto-generated)
deepnote-convert notebook.ipynb -o output/If not specified, the output file is saved in the current directory.
# Convert with custom project name
deepnote-convert titanic.ipynb --projectName "Titanic Analysis"
# Convert directory with custom output location
deepnote-convert ./analysis --projectName "Data Science Project" -o ./output
# Convert multiple notebooks from a folder
deepnote-convert ~/notebooks/ml-experiments -o ~/projects/
# Convert and specify both name and output
deepnote-convert data.ipynb --projectName "Data Exploration" -o projects/exploration.deepnoteYou can use the conversion function programmatically in Node.js or TypeScript applications. Learn more in our converter docs section.
The resulting .deepnote file contains:
metadata:
createdAt: "2024-01-01T00:00:00.000Z"
project:
id: "unique-project-id"
name: "Project Name"
notebooks:
- id: "notebook-id"
name: "Notebook Name"
blocks:
- id: "block-id"
type: "code" | "markdown"
content: "cell content"
outputs: [...]
executionCount: 1
version: "1.0.0"- Raw cells: Raw cells are not currently converted
- Widgets: Interactive widgets may not be fully preserved
- Extensions: Jupyter extensions and custom cell types are not supported
- Kernel metadata: Kernel-specific metadata is not preserved
While the CLI tool currently only supports converting Jupyter notebooks to Deepnote format, you can convert Deepnote projects back to Jupyter notebooks using the Deepnote web application:
- Upload to Deepnote: Go to deepnote.com and upload your
.deepnotefile to create a new project - Open the project: Once uploaded, open the project in Deepnote
- Download as Jupyter notebook: For each notebook in your project, click the notebook menu (three dots) and select "Download as .ipynb"
- Export the notebook: The notebook will be downloaded as a standard Jupyter notebook file that you can use in any Jupyter-compatible environment
This workflow allows you to work with Deepnote's enhanced features and collaboration tools, then export your work back to the standard Jupyter format when needed.
Convert an entire project directory:
deepnote-convert ~/jupyter-projects/data-analysis \
--projectName "Data Analysis Project" \
-o ~/deepnote-projects/Create a script to convert multiple projects:
import { convertIpynbFilesToDeepnoteFile } from "@deepnote/convert";
import { readdir } from "node:fs/promises";
import { join } from "node:path";
async function convertAllNotebooks(inputDir: string, outputDir: string) {
const files = await readdir(inputDir);
const ipynbFiles = files
.filter((f) => f.endsWith(".ipynb"))
.map((f) => join(inputDir, f));
for (const file of ipynbFiles) {
const name = file.replace(".ipynb", "");
await convertIpynbFilesToDeepnoteFile([file], {
outputPath: join(outputDir, `${name}.deepnote`),
projectName: name,
});
}
}