bibliotekar.nb.Notebook#
- class bibliotekar.nb.Notebook(nb, *, name)[source]#
A Jupyter notebook.
Methods
__init__
(nb, *, name)Convert the notebook to a Python script.
execute_with_pixi
(*, folder[, pixi, ...])Execute the notebook with pixi.
load
(path)Load a notebook from a file.
save
(path)Save the notebook to a file.
Return a new notebook with all development-only cells removed.
Return the tracking metadata associated with the notebook, if any.
with_metadata_cell
(metadata)Insert a Markdown cell at the top of the notebook with some metadata.
with_tracking_data
(metadata)Return a new notebook with new tracking metadata.
Attributes
FORMAT_VERSION
- execute_with_pixi(*, folder, pixi='pixi', pixi_env=None, timeout=10.0)[source]#
Execute the notebook with pixi.
The notebook is first converted to a Python script which is saved in the given folder. The script is then executed with IPython to allow for widgets and other IPython-specific features.
- Return type:
- strip_dev_cells()[source]#
Return a new notebook with all development-only cells removed.
Any cell with the tag “remove-cell” is removed.
- Return type:
- tracking_data()[source]#
Return the tracking metadata associated with the notebook, if any.
- Return type: