package jupyter

  1. Overview
  2. Docs

Contents on SHELL channels

type status =
  1. | SHELL_OK
  2. | SHELL_ERROR
  3. | SHELL_ABORT
val status_to_yojson : status -> Yojson.Safe.t

Execution requests and replies

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

Instrospection

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

Completion

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

History

type history_request = {
  1. hist_output : bool;
  2. hist_raw : bool;
  3. hist_access_type : string;
  4. hist_session : int option;
  5. hist_start : int option;
  6. hist_stop : int option;
  7. hist_n : int;
  8. hist_pattern : string option;
  9. hist_unique : bool;
}
val history_request_to_yojson : history_request -> Yojson.Safe.t
type history_reply = {
  1. history : (int option * int * string) list;
}
val history_reply_to_yojson : history_reply -> Yojson.Safe.t

Code completeness

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

Connect

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

Comm info

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

Kernel information

type language_info = {
  1. lang_name : string;
    (*

    language name

    *)
  2. lang_version : string;
    (*

    language version

    *)
  3. lang_mimetype : string;
    (*

    mimetype

    *)
  4. lang_file_ext : string;
    (*

    file extension

    *)
  5. lang_lexer : string option;
    (*

    pygments lexer

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

    codemirror mode

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

    protocol version

    *)
  2. kernel_impl : string;
  3. kernel_impl_ver : string;
  4. kernel_banner : string;
  5. kernel_lang_info : language_info;
  6. 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 = {
  1. shutdown_restart : bool;
}
val shutdown_to_yojson : shutdown -> Yojson.Safe.t

Request

type request =
  1. | SHELL_KERNEL_INFO_REQ
  2. | SHELL_EXEC_REQ of exec_request
  3. | SHELL_INSPECT_REQ of inspect_request
  4. | SHELL_COMPLETE_REQ of complete_request
  5. | SHELL_HISTORY_REQ of history_request
  6. | SHELL_IS_COMPLETE_REQ of is_complete_request
  7. | SHELL_CONNECT_REQ
  8. | SHELL_COMM_INFO_REQ of comm_info_request
  9. | SHELL_SHUTDOWN_REQ of shutdown
  10. | SHELL_COMM_OPEN of Comm.t
  11. | SHELL_COMM_MSG of Comm.t
  12. | SHELL_COMM_CLOSE of Comm.t
val request_to_yojson : request -> Yojson.Safe.t

Reply

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