jupyter-kernel

Library to write jupyter kernels (interactive notebooks)
IN THIS PACKAGE

User-Defined Kernel

type exec_action =
| Mime of mime_data_bundle
type exec_status_ok = {
msg : string option;
actions : exec_action list;
}
type completion_status = {
completion_matches : string list;
completion_start : int;
completion_end : int;
}
type is_complete_reply =
| Is_complete
| Is_not_complete of string
type history_request = Protocol_j.history_request
type inspect_request = Protocol_j.inspect_request = {
ir_code : string;
ir_cursor_pos : int;
ir_detail_level : int;
}
type inspect_reply_ok = {
iro_status : string;
iro_found : bool;
iro_data : mime_data_bundle;
}
val mime : ?base64:bool -> ty:string -> string -> exec_action
val ok : ?actions:exec_action list -> string option -> exec_status_ok
type t = private {
init : unit -> unit Lwt.t;
deinit : unit -> unit Lwt.t;(*

Called before stopping the kernel.

  • since 0.8
*)
exec : count:int -> string -> exec_status_ok or_error Lwt.t;
is_complete : string -> is_complete_reply Lwt.t;
language : string;
language_version : int list;
banner : string option;
file_extension : string;
mime_type : string option;
codemirror_mode : string option;
complete : pos:int -> string -> completion_status Lwt.t;
inspect : inspect_request -> inspect_reply_ok or_error Lwt.t;
history : history_request -> string list Lwt.t;
}

Type of Jupyter kernels.

A kernel is responsible for running snippets of code from cells in a notebook, or command line statements. It can also answer semantic queries such as completion, inspection, etc.

The type is a private alias as off 0.8. Use make to build.

val make : ?banner:string -> ?file_extension:string -> ?mime_type:string -> ?codemirror_mode:string -> ?init:( unit -> unit Lwt.t ) -> ?deinit:( unit -> unit Lwt.t ) -> ?is_complete:( string -> is_complete_reply Lwt.t ) -> ?complete:( pos:int -> string -> completion_status Lwt.t ) -> ?inspect:( inspect_request -> inspect_reply_ok or_error Lwt.t ) -> ?history:( history_request -> string list Lwt.t ) -> language_version:int list -> language:string -> exec:( count:int -> string -> exec_status_ok or_error Lwt.t ) -> unit -> t

Make a kernel