{ } Raw JSON

bundles / nbformat latest / nbformat / write

function

nbformat:write

source: /nbformat/__init__.py:177

Signature

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

Summary

Write a notebook to a file in a given nbformat version.

Extended Summary

The file-like object must accept unicode input.

Parameters

nb : NotebookNode

The notebook to write.

fp : file or str

Any file-like object with a write method that accepts unicode, or a path to write a file.

version : int, optional

The nbformat version to write. If nb is not this version, it will be converted. 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.

Aliases

  • nbformat.write