Framework for Python

Saving Work

save_notebook()

Render a Quarto notebook or Jupyter notebook and save the result.

Rendering uses the quarto command, which must be installed.

Usage

save_notebook(
    file: str | Path,
    name: str | None = None,
    format: str = 'html',
    public: bool = False,
    overwrite: bool = True,
    embed_resources: bool = True,
    quarto_args: Sequence[str] = (),
) -> Path

Arguments

Name Type Default Description
file required str | Path

A .qmd or .ipynb file.

name str | None None

Output file name without extension. Default: the notebook's name.

format str 'html'

"html", "pdf", or "docx".

public bool False

In a sensitive project, save to the public notebooks folder.

overwrite bool True

Replace an existing file.

embed_resources bool True

For HTML, embed images and styles in one file.

quarto_args Sequence[str] ()

Extra arguments for quarto render.