nbproject.publish#

nbproject.publish(*, version=None, i_confirm_i_saved=False, **kwargs)#

Publish the notebook.

Runs these checks: 1. Checks consecutiveness, i.e., whether notebook cells were executed consecutively. 2. Checks that the notebook has a title. 3. Checks that the notebook is published from its last cell.

Writes these data: 1. Sets version. 2. Stores currently imported python packages with their versions.

Returns None upon success and an error code otherwise.

Parameters
  • version – If None, bumps the version from “draft” to “1”, from “1” to “2”, etc. Otherwise sets the version to the passed version.

  • i_confirm_i_saved – Only relevant outside Jupyter Lab as a safeguard against losing the editor buffer content because of accidentally publishing.

Return type

Optional[str]