notebook

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package notebook decodes the small, stable subset of the Jupyter notebook format needed by source analyzers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPath

func IsPath(path string) bool

IsPath reports whether path names an IPython notebook.

func Location

func Location(rel string, index int) string

Location returns the stable finding identity for a cell inside a notebook.

Types

type Cell

type Cell struct {
	Index          int
	Type           string
	Source         string
	Output         string
	Traceback      string
	HasOutput      bool
	ExecutionCount *int
}

Cell is one notebook cell. Index is 1-based in the original cells array, so a finding remains stable when markdown/raw cells surround code.

type Document

type Document struct {
	Cells          []Cell
	HasKernelspec  bool
	KernelLanguage string
}

Document contains the decoded notebook data that analysis needs.

func Parse

func Parse(data []byte) (Document, error)

Parse decodes a notebook without executing or interpreting its code. Output is deliberately text-only: it collects textual MIME payloads and ignores binary payloads.

Jump to

Keyboard shortcuts

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