Learn Environment
|
A class for converting Jupyter notebooks to Python scripts and processing task pools. More...
#include <notebook_converter.hpp>
Public Member Functions | |
NotebookConverter () | |
bool | convertNotebook (const QString ¬ebookPath) |
Converts a Jupyter notebook to a Python script. Ignoring code cells with "solution" tag. More... | |
void | processTaskPool () |
Modifies and copies all notebooks from task_pool to users workspace. More... | |
void | toggleSolution (const QString &filePath, const QString &solutionFilePath) |
Toggles the solution code in a Jupyter notebook. More... | |
void | resetNotebook (const QString ¬ebookPath, const QString ¬ebookSolutionPath) |
Removes solution code from a Jupyter notebook. More... | |
Static Public Member Functions | |
static bool | hasSolutionCells (const QString ¬ebookPath) |
Checks if the notebook contains any solution cells. More... | |
A class for converting Jupyter notebooks to Python scripts and processing task pools.
The NotebookConverter class provides functionality to convert Jupyter notebooks into Python scripts, ignoring code cells with a "solution" tag. It also processes and modifies notebooks from a task pool, removing solution code and adding metadata tags to indicate modified cells.
The class includes methods for reading and writing files, parsing JSON content, and processing notebook cells. It ensures that the structure of the notebook is preserved while removing solution code and adding necessary metadata.
|
explicit |
bool NotebookConverter::convertNotebook | ( | const QString & | notebookPath | ) |
Converts a Jupyter notebook to a Python script. Ignoring code cells with "solution" tag.
notebookPath | Path to the notebook file. |
|
static |
Checks if the notebook contains any solution cells.
notebookPath | Path to the notebook file. |
void NotebookConverter::processTaskPool | ( | ) |
Modifies and copies all notebooks from task_pool to users workspace.
void NotebookConverter::resetNotebook | ( | const QString & | notebookPath, |
const QString & | notebookSolutionPath | ||
) |
Removes solution code from a Jupyter notebook.
notebookPath | Path to the notebook file. |
void NotebookConverter::toggleSolution | ( | const QString & | filePath, |
const QString & | solutionFilePath | ||
) |
Toggles the solution code in a Jupyter notebook.
filePath | Path to the notebook file. |
solutionFilePath | Path to the solution notebook file. |