jupyter

An OCaml kernel for Jupyter notebook
IN THIS PACKAGE
Module Jupyter . Message

Headers

type header = {
msg_id : string;(*

typically UUID, must be unique per message

*)
msg_type : string;(*

the kind of message

*)
session : string;(*

typically UUID, should be unique per session

*)
date : string option;(*

ISO8601 timestamp for when the message is created

*)
username : string;(*

the current username

*)
version : string;(*

the message protocol version

*)
}
val header_to_yojson : header -> Yojson.Safe.t
val header_of_string : string -> header
val header_option_of_string : string -> header option
val string_of_header : header -> string
val string_of_header_option : header option -> string

Top-level message

type 'content t = {
zmq_ids : string list;
content : 'content;(*

The actual content of the message must be a dict, whose structure depends on the message type.

*)
header : header;(*

The message header contains a pair of unique identifiers for the originating session and the actual message id, in addition to the username for the process that generated the message. This is useful in collaborative settings where multiple users may be interacting with the same kernel simultaneously, so that frontends can label the various messages in a meaningful way.

*)
parent_header : header option;(*

In a chain of messages, the header from the parent is copied so that clients can track where messages come from.

*)
metadata : string;(*

Any metadata associated with the message.

*)
buffers : string list;(*

optional: buffers is a list of binary data buffers for implementations that support binary extensions to the protocol.

*)
}
val to_yojson : 'content. ( 'content -> Yojson.Safe.t ) -> 'content t -> Yojson.Safe.t
val epoch_to_iso8601_string : float -> string
val create_next : ?time:float -> content_to_yojson:( 'a -> [> `List of [> `String of string ] list ] ) -> 'b t -> 'a -> 'a t
val create_next_shell : ?time:float -> 'a t -> Shell.reply -> Shell.reply t
val create_next_iopub : ?time:float -> 'a t -> Iopub.reply -> Iopub.reply t
val create_next_stdin : ?time:float -> 'a t -> Stdin.reply -> Stdin.reply t

Messages

type request =
| SHELL_REQ of Shell.request t
| STDIN_REQ of Stdin.request t
val request_to_yojson : request -> Yojson.Safe.t
type reply =
| SHELL_REP of Shell.reply t
| IOPUB_REP of Iopub.reply t
| STDIN_REP of Stdin.reply t
val reply_to_yojson : reply -> Yojson.Safe.t