:::note Generated reference Generated from honeyframeapi 0.1.8 — do not edit by hand. :::
honeyframeapi.notebook
Notebooks — list, create, read, edit cells, and delete project notebooks.
Honeyframe notebooks are Jupyter-like documents (a list of code/markdown cells)
stored per project. This module covers CRUD over a notebook's metadata + cell
content, plus .ipynb import/export.
proj = client.get_project(1)
nb = proj.create_notebook("explore", cells=["hub_info()"])
nb.append_cell("hub_read_sql('SELECT count(*) FROM marts.fact_orders')")
print([c["source"] for c in nb.cells])
Backed by /api/notebooks (list/create/get/update/delete). Kernel/session
execution (starting a running kernel and executing cells) is interactive and
intentionally out of this client's scope — edit cells here, run them in the UI.
class Notebook
A handle to a project notebook.
Notebook.get()
get() -> dict
Fetch the notebook (incl. all cells).
Notebook.cells
property
cells: list[dict]
The notebook's cells (fetches once if not already loaded).
Notebook.update()
update(*, name: Optional[str] = None, description: Optional[str] = None, cells: Optional[list] = None, tags: Optional[list] = None) -> Notebook
Update notebook fields (PUT). Only the fields you pass change;
cells items may be source strings or full cell dicts.
Notebook.set_cells()
set_cells(cells: list) -> Notebook
Replace all cells (each a source string or a cell dict).
Notebook.append_cell()
append_cell(source, *, cell_type: str = 'code') -> Notebook
Append a single cell (source string or dict) after the current ones.
Notebook.delete()
delete() -> None
Delete the notebook (soft-delete server-side).
Notebook.to_ipynb()
to_ipynb() -> dict
The notebook as an nbformat-4.5 dict (json.dump it to get a
.ipynb). Sources round-trip; platform outputs are not exported.
Notebook.export_ipynb()
export_ipynb(path) -> str
Write the notebook to path as a .ipynb file. Returns the
path written. Round-trips with Project.import_ipynb.
Functions
list_notebooks()
list_notebooks(project) -> list[dict]
List the current project's notebooks (metadata + cell counts).
create_notebook()
create_notebook(project, name: str, *, description: str = '', cells: Optional[list] = None, tags: Optional[list] = None) -> Notebook
Create a notebook and return a Notebook handle. cells items
may be source strings or full cell dicts; omit it for a starter cell.
get_notebook()
get_notebook(project, notebook_id: int) -> Notebook
Fetch a notebook by id → a populated Notebook handle.
import_ipynb()
import_ipynb(project, src, *, name: Optional[str] = None, description: str = '', tags: Optional[list] = None) -> Notebook
Import a Jupyter .ipynb as a platform notebook.
src is a path to an .ipynb file or an already-parsed nbformat
dict. name defaults to the file's stem. Markdown/raw cells import as
markdown, code as code; Jupyter outputs are dropped (see
_cells_from_ipynb).
nb = proj.import_ipynb("explore_orders.ipynb")
nb.export_ipynb("roundtrip.ipynb")
Verified against honeyframeapi 0.1.8.