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"` // Could be []string, but we always convert it to a single string
Metadata map[string]interface{} `json:"metadata"`
Outputs []Output `json:"outputs,omitempty"`
}
Cell represents a single cell within a Jupyter Notebook.
func (*Cell) UnmarshalJSON ¶ added in v0.0.113
UnmarshalJSON custom unmarshals a Cell to ensure Source is always a single string.
type KernelSpec ¶ added in v0.0.113
KernelSpec represents the kernel specification in the metadata.
type LanguageInfo ¶ added in v0.0.113
LanguageInfo represents the language information in the metadata.
type Metadata ¶ added in v0.0.113
type Metadata struct {
KernelSpec KernelSpec `json:"kernelspec"`
LanguageInfo LanguageInfo `json:"language_info"`
}
Metadata represents the metadata of a Jupyter Notebook.
type Notebook ¶
type Notebook struct {
Metadata Metadata `json:"metadata"`
Nbformat int `json:"nbformat"`
NbformatMinor int `json:"nbformat_minor"`
Cells []Cell `json:"cells"`
}
Notebook represents a Jupyter Notebook containing multiple cells.
type Output ¶
type Output struct {
OutputType string `json:"output_type"`
Text string `json:"text,omitempty"` // Could be []string, but we always convert it to a single string
Data map[string]interface{} `json:"data,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
ErrorName string `json:"ename,omitempty"`
ErrorValue string `json:"evalue,omitempty"`
Traceback []string `json:"traceback,omitempty"`
}
Output represents the output of a cell in a Jupyter Notebook.
func (*Output) UnmarshalJSON ¶ added in v0.0.113
UnmarshalJSON custom unmarshals an Output to ensure Text is always a single string.
Click to show internal directories.
Click to hide internal directories.