package jupyter-kernel

  1. Overview
  2. Docs

User-Defined Kernel

type exec_action =
  1. | Mime of mime_data_bundle
type exec_status_ok = {
  1. msg : string option;
  2. actions : exec_action list;
}
type completion_status = {
  1. completion_matches : string list;
  2. completion_start : int;
  3. completion_end : int;
}
type is_complete_reply =
  1. | Is_complete
  2. | Is_not_complete of string
type history_request = Protocol_j.history_request
type inspect_request = Protocol_j.inspect_request = {
  1. ir_code : string;
  2. ir_cursor_pos : int;
  3. ir_detail_level : int;
}
type inspect_reply_ok = {
  1. iro_status : string;
  2. iro_found : bool;
  3. 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 {
  1. init : unit -> unit Lwt.t;
  2. deinit : unit -> unit Lwt.t;
    (*

    Called before stopping the kernel.

    • since 0.8
    *)
  3. exec : count:int -> string -> exec_status_ok or_error Lwt.t;
  4. is_complete : string -> is_complete_reply Lwt.t;
  5. language : string;
  6. language_version : int list;
  7. banner : string option;
  8. file_extension : string;
  9. mime_type : string option;
  10. codemirror_mode : string option;
  11. complete : pos:int -> string -> completion_status Lwt.t;
  12. inspect : inspect_request -> inspect_reply_ok or_error Lwt.t;
  13. 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

OCaml

Innovation. Community. Security.