appyter.ext.nbclient package

Module contents

class appyter.ext.nbclient.NotebookClientIOPubHook(**kwargs: Any)[source]

Bases: nbclient.client.NotebookClient

A notebook client with the ability to hook into iopub updates

async async_execute_cell(cell: nbformat.notebooknode.NotebookNode, cell_index: int, execution_count: Optional[int, None] = None, store_history: bool = True) → nbformat.notebooknode.NotebookNode[source]

Executes a single code cell.

To execute all cells see :meth:execute.

cell : nbformat.NotebookNode The cell which is currently being processed. cell_index : int The position of the cell within the notebook object. execution_count : int The execution count to be assigned to the cell (default: Use kernel response) store_history : bool Determines if history should be stored in the kernel (default: False). Specific to ipython kernels, which can store command histories.

output : dict The execution output payload (or None for no output).

CellExecutionError If execution failed and should raise an exception, this will be raised with defaults about the failure.

cell : NotebookNode The cell which was just processed.

async_setup_kernel(**kwargs) → AsyncGenerator[source]

Context manager for setting up the kernel to execute a notebook.

This assigns the Kernel Manager (self.km) if missing and Kernel Client(self.kc).

When control returns from the yield it stops the client’s zmq channels, and shuts down the kernel.