bibliotekar.Notebook#
- class bibliotekar.Notebook(nb, *, name)[source]#
A Jupyter notebook.
Methods
__init__(nb, *, name)Convert the notebook to a Python script.
execute_with_pixi(*, folder, env[, timeout])Execute the notebook with pixi.
load(path)Load a notebook from a file.
save(path)Save the notebook to a file.
set_kernelspec([kernelspec_name, ...])Set the kernel metadata for the notebook.
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, env, 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:
- set_kernelspec(kernelspec_name='conda-env-ESS-py', kernelspec_display_name='ESS', kernelspec_language='python')[source]#
Set the kernel metadata for the notebook.
Default is the base ESS environment.
- 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: