{ } Raw JSON

bundles / nbformat latest / nbformat / writes

function

nbformat:writes

source: /nbformat/__init__.py:104

Signature

def writes(nb, version = nbformat.NO_CONVERT, capture_validation_error = None, **kwargs)

Summary

Write a notebook to a string in a given format in the given nbformat version.

Extended Summary

Any notebook format errors will be logged.

Parameters

nb : NotebookNode

The notebook to write.

version : int, optional

The nbformat version to write. If unspecified, or specified as nbformat.NO_CONVERT, the notebook's own version will be used and no conversion performed.

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

s : unicode

The notebook as a JSON string.

Aliases

  • nbformat.writes