public class JupyterCell extends Object
Currently only source code cells containing python are supported. The format was reverse-engineered by looking at an ipynb file saved by the Jupyter installation I happen to have on my machine.
| Constructor and Description |
|---|
JupyterCell(List<String> lines)
Constructs a Jupyter code cell based on a given list of source code
lines.
|
JupyterCell(String[] lines)
Convenience constructor for an array of lines.
|
| Modifier and Type | Method and Description |
|---|---|
org.json.JSONObject |
toJson()
Turns this cell into a JSON object, suitable for export.
|
static org.json.JSONObject |
toNotebook(List<JupyterCell> cells)
Turns a list of cells into a JSON representation of a notebook,
suitable for export to an ipynb file.
|
public JupyterCell(List<String> lines)
lines - lines of code, no trailing newlines requiredpublic JupyterCell(String[] lines)
lines - lines of code, no trailing newlines requiredpublic org.json.JSONObject toJson()
public static org.json.JSONObject toNotebook(List<JupyterCell> cells)
cells - list of cellsCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.