{ } Raw JSON

bundles / nbformat latest / nbformat / validator / validate

function

nbformat.validator:validate

source: /nbformat/validator.py:388

Signature

def validate(nbdict: Any = None, ref: str | None = None, version: int | None = None, version_minor: int | None = None, relax_add_props: bool = False, nbjson: Any = None) → None

Summary

Checks whether the given notebook dict-like object conforms to the relevant notebook format schema.

Parameters

nbdict : dict

notebook document

ref : optional, str

reference to the subset of the schema we want to validate against. for example "markdown_cell", "code_cell" ....

version : int
version_minor : int
relax_add_props : bool

Whether to allow extra properties in the JSON schema validating the notebook. When True, all known fields are validated, but unknown fields are ignored.

nbjson

Returns

: None

Raises

: ValidationError if not valid.

Notes

Please explicitly call normalize if you need to normalize notebooks.

Aliases

  • nbformat.validate