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

Function readAndConvertPercentFile

packages/convert/src/percent-to-deepnote.ts:219–236  ·  view source on GitHub ↗
(
  inputFilePath: string,
  options: ReadAndConvertPercentFileOptions
)

Source from the content-addressed store, hash-verified

217 * @returns A DeepnoteFile object
218 */
219export async function readAndConvertPercentFile(
220 inputFilePath: string,
221 options: ReadAndConvertPercentFileOptions
222): Promise<DeepnoteFile> {
223 const content = await fs.readFile(inputFilePath, 'utf-8')
224 const notebook = parsePercentFormat(content)
225
226 return convertPercentNotebookToDeepnote(
227 {
228 filename: basename(inputFilePath),
229 notebook,
230 },
231 {
232 projectName: options.projectName,
233 projectId: options.projectId,
234 }
235 )
236}
237
238/**
239 * Converts a single percent format (.py) file into a Deepnote project file.

Callers 2

readAndConvertOneFunction · 0.90

Calls 2

parsePercentFormatFunction · 0.85

Tested by

no test coverage detected