bundles / nbformat latest / 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: unicodeThe raw unicode string to read the notebook from.
as_version: intThe 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, optionalIf provided, a key of "ValidationError" with a value of the ValidationError instance will be added to the dictionary.
Returns
nb: NotebookNodeThe notebook that was read.
Aliases
nbformat.reads