Documentation
¶
Overview ¶
This file is define ipython notebook format see more https://nbformat.readthedocs.io/en/latest/format_description.html
Index ¶
- Constants
- func NameOfPath(name string) string
- func NamespaceOfPath(name string) string
- func Path(namespace, name string) string
- type CreateParam
- type Factory
- type IPythonNotebook
- type IPythonNotebookCell
- type IPythonNotebookCellOutput
- type IPythonNotebookKernelSpec
- type IPythonNotebookLanguageInfo
- type IPythonNotebookMeta
- type ImportNotebooksEvent
- type Notebook
- type Repository
- type Service
Constants ¶
View Source
const (
ImportNotebooks = "ImportNotebooks"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateParam ¶
type IPythonNotebook ¶
type IPythonNotebook struct {
Meta IPythonNotebookMeta `json:"metadata"`
Cells []IPythonNotebookCell `json:"cells"`
Format int `json:"nbformat" validate:"required,min=4"`
FormatMinor int `json:"nbformat_minor"`
}
type IPythonNotebookCell ¶
type IPythonNotebookCell struct {
ID string `json:"id"`
Type string `json:"cell_type" validate:"required,oneof=code markdown raw"`
Meta map[string]interface{} `json:"metadata"`
ExecutionCount *int `json:"execution_count"`
Source []string `json:"source"`
Outputs []IPythonNotebookCellOutput `json:"outputs"`
Attachments map[string]interface{} `json:"attachments"`
}
type IPythonNotebookCellOutput ¶
type IPythonNotebookCellOutput struct {
Type string `json:"output_type" validate:"required,oneof=stream display_data execute_result error"`
Name string `json:"name" validate:"required"`
Text []string `json:"text"`
// in display data
Meta map[string]interface{} `json:"metadata"`
Data map[string]interface{} `json:"data"`
// in execute result; used to be pyout / prompt_number
ExecutionCount int `json:"execute_count"`
// In errors
EName string `json:"ename"`
EValue string `json:"evalue"`
Traceback []string `json:"traceback"`
}
type IPythonNotebookLanguageInfo ¶
type IPythonNotebookLanguageInfo struct {
Name string `json:"name" validate:"required,oneof=python R"`
Version string `json:"version" validate:"required"`
PygmentsLexer string `json:"pygments_lexer"`
// codemirror_mode in docs is string but jupyter created is {"name":"ipython",...}
// CodeMirrorMode string `json:"codemirror_mode"`
FileExtension string `json:"file_extension" validate:"required"`
MimeType string `json:"mimetype" validate:"required"`
}
type IPythonNotebookMeta ¶
type IPythonNotebookMeta struct {
LanguageInfo IPythonNotebookLanguageInfo `json:"language_info"`
KernelSpec IPythonNotebookKernelSpec `json:"kernelspec"`
MaxCellID int `json:"max_cell_id"`
}
type ImportNotebooksEvent ¶
type ImportNotebooksEvent struct {
WorkspaceID string
Schema schema.NotebookTypedSchema
ImportFileBaseDir string
}
func NewImportNotebooksEvent ¶
func NewImportNotebooksEvent(workspaceID, baseDir string, schema schema.NotebookTypedSchema) *ImportNotebooksEvent
func NewImportNotebooksEventFromPayload ¶
func NewImportNotebooksEventFromPayload(data []byte) (*ImportNotebooksEvent, error)
func (*ImportNotebooksEvent) Delay ¶
func (e *ImportNotebooksEvent) Delay() time.Duration
func (*ImportNotebooksEvent) EventType ¶
func (e *ImportNotebooksEvent) EventType() string
func (*ImportNotebooksEvent) Payload ¶
func (e *ImportNotebooksEvent) Payload() []byte
Click to show internal directories.
Click to hide internal directories.