nbformat

package
v0.0.104 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package nbformat provides utilities to read and parse Jupyter Notebook (nbformat) files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	CellType string   `json:"cell_type"`
	Source   string   `json:"source"`
	Outputs  []Output `json:"outputs"`
}

Cell represents a single cell within a Jupyter Notebook.

type Notebook

type Notebook struct {
	Cells []Cell `json:"cells"`
}

Notebook represents a Jupyter Notebook containing multiple cells.

func ReadNBFormat

func ReadNBFormat(r io.Reader) (*Notebook, error)

ReadNBFormat reads and parses a Jupyter Notebook from the given io.Reader. It returns a pointer to the Notebook struct containing the parsed content. If there is an error during reading or parsing, it returns an error.

type Output

type Output struct {
	ErrorName  string   `json:"ename"`
	ErrorValue string   `json:"evalue"`
	Traceback  []string `json:"traceback"`
	OutputType string   `json:"output_type"`
	Text       []string `json:"text"`
}

Output represents the output of a cell in a Jupyter Notebook.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL