Notebook Validation
validate
validates notebooks, using nbformat.validate()
.
This takes the notebook version into account.
When the notebook is invalid, a message explains the problem.
Only in verbose mode, will validate
report explicitly that a notebook is valid.
Otherwise, it will quietly continue.
Options
validate
does not take any special options.
Examples
Check two notebooks, one valid and the other not, with verbose mode:
$ nbtb validate test.ipynb test-bad.ipynb -v
::::::::::::::
test.ipynb
::::::::::::::
test.ipynb notebook structure is valid
::::::::::::::
test-bad.ipynb
::::::::::::::
test-bad.ipynb notebook structure is INVALID
Additional properties are not allowed ('BAD_src' was unexpected)
Failed validating 'additionalProperties' in markdown_cell:
On instance['cells'][1]:
{'BAD_src': ['This is a notebook for testing purposes;\n',
'in particular, for testing the various scripts.\n',
'\n',
'It has a few formatted _MarkDown_ cells.\n',
'And some simple code cells, with various execution effects;\n',
'some (not only the last) has an error.\n',
'Various tags have been set.'],
'cell_type': 'markdown',
'metadata': {}}
Files processed: 2