# Create session
session = client.notebook.create(
workspace_id="wk_abc123",
type="small",
image="docker://quay.io/jupyter/datascience-notebook:notebook-7.5.5",
)
# Document management
doc = client.notebook.create_document("wk_abc123", "Analysis")
docs = client.notebook.list_documents("wk_abc123")
# Cell operations
cell = client.notebook.add_cell(doc.id, "print('hello')", cell_type="code")
result = client.notebook.execute_cell(doc.id, cell_id=cell.id, wait=True)
client.notebook.update_cell(doc.id, "print('updated')", cell_id=cell.id)
client.notebook.remove_cell(doc.id, cell_id=cell.id)
# Kernel management
client.notebook.ensure_kernel(doc.id, wait=True, timeout=120)
# Import / export
doc = client.notebook.import_document("wk_abc123", file_path="./notebook.ipynb")
content = client.notebook.export_document(doc.id)