jupyter

An OCaml kernel for Jupyter notebook
IN THIS PACKAGE
Module Jupyter . Shell
type status =
| SHELL_OK
| SHELL_ERROR
| SHELL_ABORT
val status_to_yojson : status -> Yojson.Safe.t

Execution requests and replies

type exec_request = {
exec_code : string;
exec_silent : bool;
exec_store_history : bool;
exec_user_expr : Yojson.Safe.t;
exec_allow_stdin : bool;
exec_stop_on_error : bool;
}
val exec_request_to_yojson : exec_request -> Yojson.Safe.t
type exec_reply = {
exec_count : int;
exec_status : status Json.enum;
}
val exec_reply_to_yojson : exec_reply -> Yojson.Safe.t

Instrospection

type inspect_request = {
insp_code : string;
insp_pos : int;
insp_detail : int;
}
val inspect_request_to_yojson : inspect_request -> Yojson.Safe.t
type inspect_reply = {
insp_status : status Json.enum;
insp_found : bool;
insp_data : Yojson.Safe.t;
insp_metadata : Yojson.Safe.t;
}
val inspect_reply_to_yojson : inspect_reply -> Yojson.Safe.t

Completion

type complete_request = {
cmpl_code : string;
cmpl_pos : int;
}
val complete_request_to_yojson : complete_request -> Yojson.Safe.t
type complete_reply = {
cmpl_matches : string list;
cmpl_start : int;
cmpl_end : int;
cmpl_metadata : Yojson.Safe.t;
cmpl_status : status Json.enum;
}
val complete_reply_to_yojson : complete_reply -> Yojson.Safe.t

History

type history_request = {
hist_output : bool;
hist_raw : bool;
hist_access_type : string;
hist_session : int option;
hist_start : int option;
hist_stop : int option;
hist_n : int;
hist_pattern : string option;
hist_unique : bool;
}
val history_request_to_yojson : history_request -> Yojson.Safe.t
type history_reply = {
history : (int option * int * string) list;
}
val history_reply_to_yojson : history_reply -> Yojson.Safe.t

Code completeness

type is_complete_request = {
is_cmpl_code : string;
}
val is_complete_request_to_yojson : is_complete_request -> Yojson.Safe.t
type is_complete_reply = {
is_cmpl_status : string;
is_cmpl_indent : string option;
}
val is_complete_reply_to_yojson : is_complete_reply -> Yojson.Safe.t

Connect

type connect_reply = {
conn_shell_port : int;
conn_iopub_port : int;
conn_stdin_port : int;
conn_hb_port : int;
conn_ctrl_port : int;
}
val connect_reply_to_yojson : connect_reply -> Yojson.Safe.t

Comm info

type comm_info_request = {
ci_target : string option;
}
val comm_info_request_to_yojson : comm_info_request -> Yojson.Safe.t
type comm_info_reply = {
ci_comms : Yojson.Safe.t;
}
val comm_info_reply_to_yojson : comm_info_reply -> Yojson.Safe.t

Kernel information

type language_info = {
lang_name : string;(*

language name

*)
lang_version : string;(*

language version

*)
lang_mimetype : string;(*

mimetype

*)
lang_file_ext : string;(*

file extension

*)
lang_lexer : string option;(*

pygments lexer

*)
lang_mode : Yojson.Safe.t;(*

codemirror mode

*)
lang_exporter : string option;
}
val language_info_to_yojson : language_info -> Yojson.Safe.t
val language_info : language_info
type kernel_info_reply = {
kernel_prot_ver : string;(*

protocol version

*)
kernel_impl : string;
kernel_impl_ver : string;
kernel_banner : string;
kernel_lang_info : language_info;
kernel_lang : string;
}
val kernel_info_reply_to_yojson : kernel_info_reply -> Yojson.Safe.t
val kernel_info_reply : kernel_info_reply

Kernel shutdown

type shutdown = {
shutdown_restart : bool;
}
val shutdown_to_yojson : shutdown -> Yojson.Safe.t

Request

type request =
| SHELL_KERNEL_INFO_REQ
| SHELL_EXEC_REQ of exec_request
| SHELL_INSPECT_REQ of inspect_request
| SHELL_COMPLETE_REQ of complete_request
| SHELL_HISTORY_REQ of history_request
| SHELL_IS_COMPLETE_REQ of is_complete_request
| SHELL_CONNECT_REQ
| SHELL_COMM_INFO_REQ of comm_info_request
| SHELL_SHUTDOWN_REQ of shutdown
| SHELL_COMM_OPEN of Comm.t
| SHELL_COMM_MSG of Comm.t
| SHELL_COMM_CLOSE of Comm.t
val request_to_yojson : request -> Yojson.Safe.t

Reply

type reply =
| SHELL_KERNEL_INFO_REP of kernel_info_reply
| SHELL_EXEC_REP of exec_reply
| SHELL_INSPECT_REP of inspect_reply
| SHELL_COMPLETE_REP of complete_reply
| SHELL_HISTORY_REP of history_reply
| SHELL_IS_COMPLETE_REP of is_complete_reply
| SHELL_CONNECT_REP of connect_reply
| SHELL_COMM_INFO_REP of comm_info_reply
| SHELL_SHUTDOWN_REP of shutdown
val reply_to_yojson : reply -> Yojson.Safe.t
val execute_reply : count:int -> status Json.enum -> reply