{ } Raw JSON

bundles / nbformat 5.11.1 / nbformat / reads

function

nbformat:reads

source: /nbformat/__init__.py:66

Signature

def reads(s, as_version, capture_validation_error = None, **kwargs)

Summary

Read a notebook from a string and return the NotebookNode object as the given version.

Extended Summary

The string can contain a notebook of any version. The notebook will be returned as_version, converting, if necessary.

Notebook format errors will be logged.

Parameters

s : unicode

The raw unicode string to read the notebook from.

as_version : int

The version of the notebook format to return. The notebook will be converted, if necessary. Pass nbformat.NO_CONVERT to prevent conversion.

capture_validation_error : dict, optional

If provided, a key of "ValidationError" with a value of the ValidationError instance will be added to the dictionary.

Returns

nb : NotebookNode

The notebook that was read.

Aliases

  • nbformat.reads