MCPcopy Index your code
hub / github.com/deepnote/deepnote / readAndConvertOne

Function readAndConvertOne

packages/convert/src/cli.ts:204–219  ·  view source on GitHub ↗

Reads and converts ONE source notebook into a single-notebook `DeepnoteFile`.

(
  format: ConvertDirectoryOptions['format'],
  inputFilePath: string,
  options: { projectName: string; projectId?: string }
)

Source from the content-addressed store, hash-verified

202
203/** Reads and converts ONE source notebook into a single-notebook `DeepnoteFile`. */
204function readAndConvertOne(
205 format: ConvertDirectoryOptions['format'],
206 inputFilePath: string,
207 options: { projectName: string; projectId?: string }
208): Promise<DeepnoteFile> {
209 switch (format) {
210 case 'jupyter':
211 return readAndConvertIpynbFile(inputFilePath, options)
212 case 'quarto':
213 return readAndConvertQuartoFile(inputFilePath, options)
214 case 'percent':
215 return readAndConvertPercentFile(inputFilePath, options)
216 case 'marimo':
217 return readAndConvertMarimoFile(inputFilePath, options)
218 }
219}
220
221/**
222 * Converts every notebook in a directory to its own single-notebook `.deepnote` file —

Callers 1

convertDirectoryFunction · 0.85

Calls 4

readAndConvertIpynbFileFunction · 0.90
readAndConvertQuartoFileFunction · 0.90
readAndConvertMarimoFileFunction · 0.90

Tested by

no test coverage detected