Interface Cell
- All Known Implementing Classes:
CodeCell, MarkdownCell, RawCell
A single cell in a Jupyter notebook. The cell type is determined by the
cell_type field and can be one of "code", "markdown",
or "raw".
The id field was added in nbformat 4.5 and is
required in nbformat 5 (nbformat_minor ≥ 4). It must
be a string of 1–64 characters matching [a-zA-Z0-9_\-]. When
reading legacy notebooks (nbformat_minor < 4) the field may be absent;
in that case id() returns null.
-
Method Details
-
cellType
-
metadata
-
source
MultilineString source()Returns the source content of the cell as a multiline string. In the notebook JSON this is stored as a list of strings or a single string; Jackson handles both viaMultilineString.- Returns:
- the cell source lines.
-
id
String id()Returns the unique cell identifier.Required in nbformat 5 (nbformat_minor ≥ 4). Must be a string of 1–64 characters matching
[a-zA-Z0-9_\-]. May benullwhen reading notebooks saved with an older minor version.- Returns:
- the cell id, or
nullfor legacy notebooks.
-