Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: nbformat.v4

The main API for the v4 notebook format.

7 Functions

IPython.nbformat.v4.downgrade(nb)

Convert a v4 notebook to v3.

Parameters:

nb : NotebookNode

The Python representation of the notebook to convert.

IPython.nbformat.v4.new_code_cell(source='', **kwargs)

Create a new code cell

IPython.nbformat.v4.new_markdown_cell(source='', **kwargs)

Create a new markdown cell

IPython.nbformat.v4.new_notebook(**kwargs)

Create a new notebook

IPython.nbformat.v4.new_output(output_type, data=None, **kwargs)

Create a new output, to go in the cell.outputs list of a code cell.

IPython.nbformat.v4.output_from_msg(msg)

Create a NotebookNode for an output from a kernel’s IOPub message.

Returns:NotebookNode: the output as a notebook node.
Raises:ValueError: if the message is not an output message.
IPython.nbformat.v4.upgrade(nb, from_version=3, from_minor=0)

Convert a notebook to v4.

Parameters:

nb : NotebookNode

The Python representation of the notebook to convert.

from_version : int

The original version of the notebook to convert.

from_minor : int

The original minor version of the notebook to convert (only relevant for v >= 3).