jupyter-kernel

Library to write jupyter kernels (interactive notebooks)
IN THIS PACKAGE
type stream = Protocol_t.stream = {
st_name : string;
st_data : string;
}
type status = Protocol_t.status = {
execution_state : string;
}
type shutdown = Protocol_t.shutdown = {
restart : bool;
}
type dyn = Yojson.Safe.t
type pyout = Protocol_t.pyout = {
po_execution_count : int;
po_data : dyn;
po_metadata : dyn;
}
type pyin = Protocol_t.pyin = {
pi_code : string;
pi_execution_count : int;
}
type payload = Protocol_t.payload = {
html : string;
source : string;
start_line_number : int;
text : string;
}
type language_info = Protocol_t.language_info = {
li_name : string;
li_version : string;
li_mimetype : string;
li_file_extension : string;
li_codemirror_mode : string option;
}
type kernel_info_reply = Protocol_t.kernel_info_reply = {
protocol_version : string;
implementation : string;
implementation_version : string;
language_info : language_info;
banner : string;
}
type is_complete_request = Protocol_t.is_complete_request = {
icr_code : string;
}
type is_complete_reply = Protocol_t.is_complete_reply = {
icr_status : string;
icr_indent : string;
}
type interrupt_reply = Protocol_t.interrupt_reply = {
status : string;
}
type inspect_request = Protocol_t.inspect_request = {
ir_code : string;
ir_cursor_pos : int;
ir_detail_level : int;
}
type inspect_reply = Protocol_t.inspect_reply = {
ir_status : string;
ir_found : bool option;
ir_data : dyn option;
ir_metadata : dyn option;
ir_ename : string option;
ir_evalue : string option;
ir_traceback : string list option;
}
type history_request = Protocol_t.history_request = {
output : bool;
raw : bool;
hist_access_type : string;
hr_session : int;
start : int;
stop : int;
n : int;
pattern : string;
unique : bool;
}
type history_reply = Protocol_t.history_reply = {
history : string list;
}
type header_info = Protocol_t.header_info = {
date : string;
version : string;
username : string option;
session : string option;
msg_id : string;
msg_type : string;
}
type execute_request = Protocol_t.execute_request = {
code : string;
silent : bool;
store_history : bool;
user_expressions : dyn;
allow_stdin : bool;
}
type execute_reply = Protocol_t.execute_reply = {
status : string;
execution_count : int;
ename : string option;
evalue : string option;
traceback : string list option;
payload : payload list option;
er_user_expressions : dyn option;
}
type execute_error = Protocol_t.execute_error = {
err_ename : string;
err_evalue : string;
err_traceback : string list;
}
type display_data = Protocol_t.display_data = {
dd_data : dyn;
dd_metadata : dyn;
dd_transient : dyn option;
}
type connection_info = Protocol_t.connection_info = {
stdin_port : int;
ip : string;
control_port : int;
hb_port : int;
signature_scheme : string;
key : string;
shell_port : int;
transport : string;
iopub_port : int;
}
type connect_reply = Protocol_t.connect_reply = {
cr_shell_port : int;
cr_iopub_port : int;
cr_stdin_port : int;
cr_hb_port : int;
}
type complete_request = Protocol_t.complete_request = {
line : string;
cursor_pos : int;
}
type complete_reply = Protocol_t.complete_reply = {
matches : string list;
cursor_start : int;
cursor_end : int;
cr_status : string;
}
type comm_info_request = Protocol_t.comm_info_request = {
target_name : string;
}
type clear_output = Protocol_t.clear_output = {
wait : bool;
stdout : bool;
stderr : bool;
other : bool;
}
val write_stream : Buffer.t -> stream -> unit

Output a JSON value of type stream.

val string_of_stream : ?len:int -> stream -> string

Serialize a value of type stream into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type stream.

val stream_of_string : string -> stream

Deserialize JSON data of type stream.

val write_status : Buffer.t -> status -> unit

Output a JSON value of type status.

val string_of_status : ?len:int -> status -> string

Serialize a value of type status into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type status.

val status_of_string : string -> status

Deserialize JSON data of type status.

val write_shutdown : Buffer.t -> shutdown -> unit

Output a JSON value of type shutdown.

val string_of_shutdown : ?len:int -> shutdown -> string

Serialize a value of type shutdown into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type shutdown.

val shutdown_of_string : string -> shutdown

Deserialize JSON data of type shutdown.

val write_dyn : Buffer.t -> dyn -> unit

Output a JSON value of type dyn.

val string_of_dyn : ?len:int -> dyn -> string

Serialize a value of type dyn into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type dyn.

val dyn_of_string : string -> dyn

Deserialize JSON data of type dyn.

val write_pyout : Buffer.t -> pyout -> unit

Output a JSON value of type pyout.

val string_of_pyout : ?len:int -> pyout -> string

Serialize a value of type pyout into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type pyout.

val pyout_of_string : string -> pyout

Deserialize JSON data of type pyout.

val write_pyin : Buffer.t -> pyin -> unit

Output a JSON value of type pyin.

val string_of_pyin : ?len:int -> pyin -> string

Serialize a value of type pyin into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type pyin.

val pyin_of_string : string -> pyin

Deserialize JSON data of type pyin.

val write_payload : Buffer.t -> payload -> unit

Output a JSON value of type payload.

val string_of_payload : ?len:int -> payload -> string

Serialize a value of type payload into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type payload.

val payload_of_string : string -> payload

Deserialize JSON data of type payload.

val write_language_info : Buffer.t -> language_info -> unit

Output a JSON value of type language_info.

val string_of_language_info : ?len:int -> language_info -> string

Serialize a value of type language_info into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_language_info : Yojson.Safe.lexer_state -> Lexing.lexbuf -> language_info

Input JSON data of type language_info.

val language_info_of_string : string -> language_info

Deserialize JSON data of type language_info.

Output a JSON value of type help_link.

Serialize a value of type help_link into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type help_link.

Deserialize JSON data of type help_link.

val write_kernel_info_reply : Buffer.t -> kernel_info_reply -> unit

Output a JSON value of type kernel_info_reply.

val string_of_kernel_info_reply : ?len:int -> kernel_info_reply -> string

Serialize a value of type kernel_info_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_kernel_info_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> kernel_info_reply

Input JSON data of type kernel_info_reply.

val kernel_info_reply_of_string : string -> kernel_info_reply

Deserialize JSON data of type kernel_info_reply.

val write_is_complete_request : Buffer.t -> is_complete_request -> unit

Output a JSON value of type is_complete_request.

val string_of_is_complete_request : ?len:int -> is_complete_request -> string

Serialize a value of type is_complete_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_is_complete_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> is_complete_request

Input JSON data of type is_complete_request.

val is_complete_request_of_string : string -> is_complete_request

Deserialize JSON data of type is_complete_request.

val write_is_complete_reply : Buffer.t -> is_complete_reply -> unit

Output a JSON value of type is_complete_reply.

val string_of_is_complete_reply : ?len:int -> is_complete_reply -> string

Serialize a value of type is_complete_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_is_complete_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> is_complete_reply

Input JSON data of type is_complete_reply.

val is_complete_reply_of_string : string -> is_complete_reply

Deserialize JSON data of type is_complete_reply.

val write_interrupt_reply : Buffer.t -> interrupt_reply -> unit

Output a JSON value of type interrupt_reply.

val string_of_interrupt_reply : ?len:int -> interrupt_reply -> string

Serialize a value of type interrupt_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_interrupt_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> interrupt_reply

Input JSON data of type interrupt_reply.

val interrupt_reply_of_string : string -> interrupt_reply

Deserialize JSON data of type interrupt_reply.

val write_inspect_request : Buffer.t -> inspect_request -> unit

Output a JSON value of type inspect_request.

val string_of_inspect_request : ?len:int -> inspect_request -> string

Serialize a value of type inspect_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_inspect_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> inspect_request

Input JSON data of type inspect_request.

val inspect_request_of_string : string -> inspect_request

Deserialize JSON data of type inspect_request.

val write_inspect_reply : Buffer.t -> inspect_reply -> unit

Output a JSON value of type inspect_reply.

val string_of_inspect_reply : ?len:int -> inspect_reply -> string

Serialize a value of type inspect_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_inspect_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> inspect_reply

Input JSON data of type inspect_reply.

val inspect_reply_of_string : string -> inspect_reply

Deserialize JSON data of type inspect_reply.

val write_history_request : Buffer.t -> history_request -> unit

Output a JSON value of type history_request.

val string_of_history_request : ?len:int -> history_request -> string

Serialize a value of type history_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_history_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> history_request

Input JSON data of type history_request.

val history_request_of_string : string -> history_request

Deserialize JSON data of type history_request.

val write_history_reply : Buffer.t -> history_reply -> unit

Output a JSON value of type history_reply.

val string_of_history_reply : ?len:int -> history_reply -> string

Serialize a value of type history_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_history_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> history_reply

Input JSON data of type history_reply.

val history_reply_of_string : string -> history_reply

Deserialize JSON data of type history_reply.

val write_header_info : Buffer.t -> header_info -> unit

Output a JSON value of type header_info.

val string_of_header_info : ?len:int -> header_info -> string

Serialize a value of type header_info into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

Input JSON data of type header_info.

val header_info_of_string : string -> header_info

Deserialize JSON data of type header_info.

val write_execute_request : Buffer.t -> execute_request -> unit

Output a JSON value of type execute_request.

val string_of_execute_request : ?len:int -> execute_request -> string

Serialize a value of type execute_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_execute_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> execute_request

Input JSON data of type execute_request.

val execute_request_of_string : string -> execute_request

Deserialize JSON data of type execute_request.

val write_execute_reply : Buffer.t -> execute_reply -> unit

Output a JSON value of type execute_reply.

val string_of_execute_reply : ?len:int -> execute_reply -> string

Serialize a value of type execute_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_execute_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> execute_reply

Input JSON data of type execute_reply.

val execute_reply_of_string : string -> execute_reply

Deserialize JSON data of type execute_reply.

val write_execute_error : Buffer.t -> execute_error -> unit

Output a JSON value of type execute_error.

val string_of_execute_error : ?len:int -> execute_error -> string

Serialize a value of type execute_error into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_execute_error : Yojson.Safe.lexer_state -> Lexing.lexbuf -> execute_error

Input JSON data of type execute_error.

val execute_error_of_string : string -> execute_error

Deserialize JSON data of type execute_error.

val write_display_data : Buffer.t -> display_data -> unit

Output a JSON value of type display_data.

val string_of_display_data : ?len:int -> display_data -> string

Serialize a value of type display_data into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_display_data : Yojson.Safe.lexer_state -> Lexing.lexbuf -> display_data

Input JSON data of type display_data.

val display_data_of_string : string -> display_data

Deserialize JSON data of type display_data.

val write_connection_info : Buffer.t -> connection_info -> unit

Output a JSON value of type connection_info.

val string_of_connection_info : ?len:int -> connection_info -> string

Serialize a value of type connection_info into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_connection_info : Yojson.Safe.lexer_state -> Lexing.lexbuf -> connection_info

Input JSON data of type connection_info.

val connection_info_of_string : string -> connection_info

Deserialize JSON data of type connection_info.

val write_connect_reply : Buffer.t -> connect_reply -> unit

Output a JSON value of type connect_reply.

val string_of_connect_reply : ?len:int -> connect_reply -> string

Serialize a value of type connect_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_connect_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> connect_reply

Input JSON data of type connect_reply.

val connect_reply_of_string : string -> connect_reply

Deserialize JSON data of type connect_reply.

val write_complete_request : Buffer.t -> complete_request -> unit

Output a JSON value of type complete_request.

val string_of_complete_request : ?len:int -> complete_request -> string

Serialize a value of type complete_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_complete_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> complete_request

Input JSON data of type complete_request.

val complete_request_of_string : string -> complete_request

Deserialize JSON data of type complete_request.

val write_complete_reply : Buffer.t -> complete_reply -> unit

Output a JSON value of type complete_reply.

val string_of_complete_reply : ?len:int -> complete_reply -> string

Serialize a value of type complete_reply into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_complete_reply : Yojson.Safe.lexer_state -> Lexing.lexbuf -> complete_reply

Input JSON data of type complete_reply.

val complete_reply_of_string : string -> complete_reply

Deserialize JSON data of type complete_reply.

val write_comm_info_request : Buffer.t -> comm_info_request -> unit

Output a JSON value of type comm_info_request.

val string_of_comm_info_request : ?len:int -> comm_info_request -> string

Serialize a value of type comm_info_request into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_comm_info_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> comm_info_request

Input JSON data of type comm_info_request.

val comm_info_request_of_string : string -> comm_info_request

Deserialize JSON data of type comm_info_request.

val write_clear_output : Buffer.t -> clear_output -> unit

Output a JSON value of type clear_output.

val string_of_clear_output : ?len:int -> clear_output -> string

Serialize a value of type clear_output into a JSON string.

  • parameter len

    specifies the initial length of the buffer used internally. Default: 1024.

val read_clear_output : Yojson.Safe.lexer_state -> Lexing.lexbuf -> clear_output

Input JSON data of type clear_output.

val clear_output_of_string : string -> clear_output

Deserialize JSON data of type clear_output.