Warning

This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: nbformat.v4.nbjson

Read and write notebooks in JSON format.

3 Classes

class IPython.nbformat.v4.nbjson.BytesEncoder(skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

Bases: json.encoder.JSONEncoder

A JSON encoder that accepts b64 (and other ascii) bytestrings.

class IPython.nbformat.v4.nbjson.JSONReader

Bases: IPython.nbformat.v4.rwbase.NotebookReader

reads(s, **kwargs)

Read a JSON string into a Notebook object

to_notebook(d, **kwargs)

Convert a disk-format notebook dict to in-memory NotebookNode

handles multi-line values as strings, scrubbing of transient values, etc.

class IPython.nbformat.v4.nbjson.JSONWriter

Bases: IPython.nbformat.v4.rwbase.NotebookWriter

writes(nb, **kwargs)

Serialize a NotebookNode object as a JSON string