nbformat API reference
121 public APIs from nbformat (jupyter/nbformat) — 37 classes, 35 functions, 49 methods. Signatures extracted by static analysis of the actual source.
Repository: jupyter/nbformat
| Kind | Count |
|---|---|
| Classes | 37 |
| Functions | 35 |
| Methods | 49 |
API list
class
nbformat._struct.StructA dict subclass with attribute style access.
method
nbformat._struct.Struct.copy()Return a copy as a Struct.
method
nbformat._struct.Struct.dict()Get the dict representation of the struct.
method
nbformat._struct.Struct.hasattr(key)hasattr function available as a method.
func
nbformat.corpus.words.generate_corpus_id()Generate a corpus id.
class
nbformat.current.NBFormatErrorAn error raised for an nbformat error.
func
nbformat.current.reads_json(nbjson, **kwargs)DEPRECATED, use reads
func
nbformat.current.reads_py(s, **kwargs)DEPRECATED: use nbconvert
func
nbformat.current.writes_json(nb, **kwargs)DEPRECATED, use writes
func
nbformat.current.writes_py(nb, **kwargs)DEPRECATED: use nbconvert
class
nbformat.json_compat.FastJsonSchemaValidatorA schema validator using fastjsonschema.
method
nbformat.json_compat.FastJsonSchemaValidator.validate(data)Validate incoming data.
class
nbformat.json_compat.JsonSchemaValidatorA json schema validator.
method
nbformat.json_compat.JsonSchemaValidator.validate(data)Validate incoming data.
class
nbformat.notebooknode.NotebookNodeA dict-like node with attribute-access
class
nbformat.reader.NotJSONErrorAn error raised when an object is not valid JSON.
func
nbformat.reader.get_version(nb)Get the version of a notebook.
func
nbformat.reader.parse_json(s, **kwargs)Parse a JSON string into a dict.
class
nbformat.sentinel.SentinelSentinel class for constants with useful reprs
class
nbformat.sign.MemorySignatureStoreNon-persistent storage of signatures in memory.
method
nbformat.sign.MemorySignatureStore.check_signature(digest, algorithm)Check a signature.
method
nbformat.sign.MemorySignatureStore.remove_signature(digest, algorithm)Remove a signature.
method
nbformat.sign.MemorySignatureStore.store_signature(digest, algorithm)Store a signature.
class
nbformat.sign.NotebookNotaryA class for computing and verifying notebook signatures.
method
nbformat.sign.NotebookNotary.close()Close the notary's signature store.
class
nbformat.sign.SQLiteSignatureStoreStore signatures in an SQLite database.
method
nbformat.sign.SQLiteSignatureStore.close()Close the db.
method
nbformat.sign.SQLiteSignatureStore.init_db(db)Initialize the db.
method
nbformat.sign.SQLiteSignatureStore.store_signature(digest, algorithm)Store a signature in the db.
class
nbformat.sign.SignatureStoreBase class for a signature store.
method
nbformat.sign.SignatureStore.close()Close any open connections this store may use.
class
nbformat.sign.TrustNotebookAppAn application for handling notebook trust.
method
nbformat.sign.TrustNotebookApp.generate_new_key()Generate a new notebook signature key
method
nbformat.sign.TrustNotebookApp.sign_notebook(nb, notebook_path='<stdin>')Sign a notebook that's been loaded
method
nbformat.sign.TrustNotebookApp.start()Start the trust notebook app.
func
nbformat.v1.convert.upgrade(nb, orig_version=None)Upgrade a notebook.
class
nbformat.v1.nbbase.NotebookNodeA notebook node object.
func
nbformat.v1.nbbase.from_dict(d)Create notebook node(s) from an object.
func
nbformat.v1.nbbase.new_text_cell(text=None)Create a new text cell.
class
nbformat.v1.nbjson.JSONReaderA JSON notebook reader.
method
nbformat.v1.nbjson.JSONReader.reads(s, **kwargs)Convert a string to a notebook object.
class
nbformat.v1.nbjson.JSONWriterA JSON notebook writer.
method
nbformat.v1.nbjson.JSONWriter.writes(nb, **kwargs)Convert a notebook object to a string.
class
nbformat.v1.rwbase.NotebookReaderThe base notebook reader.
method
nbformat.v1.rwbase.NotebookReader.reads(s, **kwargs)Read a notebook from a string.
class
nbformat.v1.rwbase.NotebookWriterThe base notebook writer.
method
nbformat.v1.rwbase.NotebookWriter.write(nb, fp, **kwargs)Write a notebook to a file like object
method
nbformat.v1.rwbase.NotebookWriter.writes(nb, **kwargs)Write a notebook to a string.
func
nbformat.v2.convert.downgrade(nb)Convert a v2 notebook to v1.
func
nbformat.v2.convert.upgrade(nb, from_version=1)Convert a notebook to the v2 format.
class
nbformat.v2.nbbase.NotebookNodeA notebook node object.
func
nbformat.v2.nbbase.from_dict(d)Create notebook node(s) from a value.
func
nbformat.v2.nbbase.new_author(name=None, email=None, affiliation=None, url=None)Create a new author.
func
nbformat.v2.nbbase.new_text_cell(cell_type, source=None, rendered=None)Create a new text cell.
method
nbformat.v2.nbjson.BytesEncoder.default(obj)The default value of an object.
class
nbformat.v2.nbjson.JSONReaderA JSON notebook reader.
method
nbformat.v2.nbjson.JSONReader.reads(s, **kwargs)Convert a string to a notebook.
method
nbformat.v2.nbjson.JSONReader.to_notebook(d, **kwargs)Convert a string to a notebook.
class
nbformat.v2.nbjson.JSONWriterA JSON notebook writer.
method
nbformat.v2.nbjson.JSONWriter.writes(nb, **kwargs)Convert a notebook object to a string.
class
nbformat.v2.nbpy.PyReaderA Python notebook reader.
method
nbformat.v2.nbpy.PyReader.new_cell(state, lines)Create a new cell.
method
nbformat.v2.nbpy.PyReader.reads(s, **kwargs)Convert a string to a notebook.
method
nbformat.v2.nbpy.PyReader.split_lines_into_blocks(lines)Split lines into code blocks.
method
nbformat.v2.nbpy.PyReader.to_notebook(s, **kwargs)Convert a string to a notebook.
class
nbformat.v2.nbpy.PyReaderErrorAn error raised by the PyReader.
class
nbformat.v2.nbpy.PyWriterA Python notebook writer.
method
nbformat.v2.nbpy.PyWriter.writes(nb, **kwargs)Convert a notebook object to a string.
func
nbformat.v2.nbxml.read(fp, **kwargs)REMOVED
func
nbformat.v2.nbxml.reads(s, **kwargs)REMOVED
func
nbformat.v2.nbxml.to_notebook(root, **kwargs)REMOVED
func
nbformat.v2.parse_filename(fname)Parse a notebook filename.
class
nbformat.v2.rwbase.NotebookReaderA class for reading notebooks.
method
nbformat.v2.rwbase.NotebookReader.reads(s, **kwargs)Read a notebook from a string.
class
nbformat.v2.rwbase.NotebookWriterA class for writing notebooks.
method
nbformat.v2.rwbase.NotebookWriter.write(nb, fp, **kwargs)Write a notebook to a file like object
method
nbformat.v2.rwbase.NotebookWriter.writes(nb, **kwargs)Write a notebook to a string.
func
nbformat.v3.convert.downgrade(nb)Convert a v3 notebook to v2.
func
nbformat.v3.convert.raw_to_md(cell)let raw passthrough as markdown
func
nbformat.v3.convert.upgrade(nb, from_version=2, from_minor=0)Convert a notebook to v3.
class
nbformat.v3.nbbase.NotebookNodeA notebook node object.
func
nbformat.v3.nbbase.cast_str(obj)Cast an object as a string.
func
nbformat.v3.nbbase.from_dict(d)Create notebook node(s) from an object.
func
nbformat.v3.nbbase.new_author(name=None, email=None, affiliation=None, url=None)Create a new author.
func
nbformat.v3.nbbase.new_text_cell(cell_type, source=None, rendered=None, metadata=None)Create a new text cell.
method
nbformat.v3.nbjson.BytesEncoder.default(obj)Get the default value of an object.
class
nbformat.v3.nbjson.JSONReaderA JSON notebook reader.
method
nbformat.v3.nbjson.JSONReader.reads(s, **kwargs)Convert a string to a notebook.
method
nbformat.v3.nbjson.JSONReader.to_notebook(d, **kwargs)Convert a dict to a notebook.
class
nbformat.v3.nbjson.JSONWriterA JSON notebook writer.
method
nbformat.v3.nbjson.JSONWriter.writes(nb, **kwargs)Convert a notebook to a string.
class
nbformat.v3.nbpy.PyReaderA python notebook reader.
method
nbformat.v3.nbpy.PyReader.new_cell(state, lines, **kwargs)Create a new cell.
method
nbformat.v3.nbpy.PyReader.reads(s, **kwargs)Convert a string to a notebook
method
nbformat.v3.nbpy.PyReader.split_lines_into_blocks(lines)Split lines into code blocks.
method
nbformat.v3.nbpy.PyReader.to_notebook(s, **kwargs)Convert a string to a notebook
class
nbformat.v3.nbpy.PyReaderErrorAn error raised for a pyreader error.
class
nbformat.v3.nbpy.PyWriterA Python notebook writer.
method
nbformat.v3.nbpy.PyWriter.writes(nb, **kwargs)Convert a notebook to a string.
func
nbformat.v3.parse_filename(fname)Parse a notebook filename.
class
nbformat.v3.rwbase.NotebookReaderA class for reading notebooks.
method
nbformat.v3.rwbase.NotebookReader.reads(s, **kwargs)Read a notebook from a string.
class
nbformat.v3.rwbase.NotebookWriterA class for writing notebooks.
method
nbformat.v3.rwbase.NotebookWriter.write(nb, fp, **kwargs)Write a notebook to a file like object
method
nbformat.v3.rwbase.NotebookWriter.writes(nb, **kwargs)Write a notebook to a string.
func
nbformat.v4.convert.downgrade(nb)Convert a v4 notebook to v3.
func
nbformat.v4.convert.upgrade(nb, from_version=None, from_minor=None)Convert a notebook to latest v4.
func
nbformat.v4.nbbase.new_code_cell(source='', **kwargs)Create a new code cell
func
nbformat.v4.nbbase.new_markdown_cell(source='', **kwargs)Create a new markdown cell
func
nbformat.v4.nbbase.new_notebook(**kwargs)Create a new notebook
func
nbformat.v4.nbbase.new_raw_cell(source='', **kwargs)Create a new raw cell
func
nbformat.v4.nbbase.validate(node, ref=None)validate a v4 node
method
nbformat.v4.nbjson.BytesEncoder.default(obj)Get the default value of an object.
class
nbformat.v4.nbjson.JSONReaderA JSON notebook reader.
class
nbformat.v4.nbjson.JSONWriterA JSON notebook writer.
class
nbformat.v4.rwbase.NotebookReaderA class for reading notebooks.
method
nbformat.v4.rwbase.NotebookReader.reads(s, **kwargs)Read a notebook from a string.
class
nbformat.v4.rwbase.NotebookWriterA class for writing notebooks.
method
nbformat.v4.rwbase.NotebookWriter.write(nb, fp, **kwargs)Write a notebook to a file like object
method
nbformat.v4.rwbase.NotebookWriter.writes(nb, **kwargs)Write a notebook to a string.
func
nbformat.validator.normalize(nbdict:Any, version:int | None=None, version_minor:int | None=None, *relax_add_props:bool=False, *strip_invalid_metadata:bool=False) -> tuple[int, Any]Normalise a notebook prior to validation.
About this data
These signatures were extracted from the public source of jupyter/nbformat
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.