.. _f-notebookrunner: module ``ipythonhelper.notebook_runner`` ======================================== .. inheritance-diagram:: pyquickhelper.ipythonhelper.notebook_runner Short summary +++++++++++++ module ``pyquickhelper.ipythonhelper.notebook_runner`` Modified version of `runipy.notebook_runner `_. :githublink:`%|py|6` Classes +++++++ +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +================================================================================================+==================================================================================================================================+ | :class:`NotebookError ` | Raised when the execution fails. | +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :class:`NotebookKernelError ` | Raised when `wait_for_ready `_ ... | +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ | :class:`NotebookRunner ` | The kernel communicates with mime-types while the notebook uses short labels for different cell types. We'll use this ... | +------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+ Static Methods ++++++++++++++ +--------------------------------------------------------------------------------------------------+-----------------------------+ | staticmethod | truncated documentation | +==================================================================================================+=============================+ | :meth:`get_cell_code ` | Returns the code of a cell. | +--------------------------------------------------------------------------------------------------+-----------------------------+ Methods +++++++ +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +=======================================================================================================================+==================================================================================================================+ | :py:meth:`__add__ ` | Merges two notebooks together, returns a new none. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__del__ ` | We close the kernel. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__len__ ` | Returns the number of cells, it iterates on cells to get this information and does cache the information. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_cell_container ` | Returns a cells container, it may change according to the format. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_check_thumbnail_tuple ` | Checks types for a thumbnail. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_merge_images ` | Merges images defined by (buffer, format). The method uses PIL to merge images when possible. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :py:meth:`_scale_image ` | Scales an image with the same aspect ratio centered in an image with a given max_width and max_height. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`add_tag_slide ` | Tries to add tags for a slide show when they are too few. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`cell_height ` | Approximates the height of a cell by its number of lines it contains. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`cell_image ` | Returns the cell image or None if not found. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`cell_metadata ` | Returns the cell metadata. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`cell_type ` | Returns the cell type. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`clean_code ` | Cleans the code before running it, the function comment out instruction such as ``show()``. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`copy ` | Copies the notebook (just the content). | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`count_code_cells ` | Returns the number of code cells in the notebook. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`create_picture_from ` | Creates a picture from text. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`first_cell ` | Returns the first cell. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`get_description ` | Gets summary and description of this notebook. We expect the first cell to contain a title and a description ... | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`get_thumbnail ` | Processes the notebook and creates one picture based on the outputs to illustrate a notebook. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`iter_cells ` | Iterates over the notebook cells. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`iter_code_cells ` | Iterates over the notebook cells containing code. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`merge_notebook ` | Appends notebook *nb* to this one. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`run_cell ` | Runs a notebook cell and update the output of that cell inplace. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`run_notebook ` | Runs all the cells of a notebook in order and update the outputs in-place. If ``skip_exceptions`` is set, ... | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`shutdown_kernel ` | Shuts down kernel. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`to_json ` | Converts the notebook into :epkg:`JSON`. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ | :meth:`to_python ` | Converts the notebook into python. | +-----------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyquickhelper.ipythonhelper.notebook_runner :members: :special-members: __init__ :show-inheritance: