get_notebook_code_cells

get_notebook_code_cells(notebook_path: str) tuple[bool, list[NotebookCell]][source]

Parse a notebook and returns a Tuple.

The first entry being a bool which indicates if juypter magic was used and the second entry is a List of all code cells, as their dict representation.

Parameters:

notebook_path (str) – Path to a notebook.

Returns:

(uses_get_ipython, notebook_cells), where uses_get_ipython is a bool, which is True if any cell contained jupyter magic and notebook_cells is a List of all code cells dict representation.

Return type:

tuple[bool, list[NotebookCell]]

Warns:

InvalidNotebookWarning – If the notebook couldn’t be parsed.