( inputFilePath: string, options: ReadAndConvertPercentFileOptions )
| 217 | * @returns A DeepnoteFile object |
| 218 | */ |
| 219 | export 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. |
no test coverage detected