operator for getting all messages that declare their parent header as parentMessage's header.
The parent message whose children we should fetch
A function that takes an Observable of kernel messages and returns messages that are children of parentMessage.
Create an object that adheres to the jupyter notebook specification. http://jupyter-client.readthedocs.io/en/latest/messaging.html
Message that has content which can be converted to nbformat
Message with the associated output type
creates a comm close message for sending to a kernel
header from a parent jupyter message
unique identifier for the comm
any data to send for the comm
jupyter message for comm_msg
creates a comm message for sending to a kernel
unique identifier for the comm
any data to send for the comm
arbitrary binary data to send on the comm
jupyter message for comm_msg
creates a comm open message
uuid
comm handler
up to the target handler
used to select a module that is responsible for handling the target_name
Message ready to send on the shell channel
Creates a header for a kernel message of a given type.
The message type to create a header for
A complete header for the message
Convert raw message frames from a Jupyter ZeroMQ connection to the object based JupyterMessage format
individual components of a message
HMAC key for frames 2+
only sha256 is supported at the moment
Creates a display_data message.
ref: http://jupyter-client.readthedocs.io/en/stable/messaging.html#display-data
displayData({username: 'rgbkrk', session: '123'}, {data: {'text/html': 'sup'}}, "display_data") { header: { msg_id: '24e95ce7-73d5-4c5f-9ef0-ff8547779690', date: 2017-10-23T22:57:58.704Z, version: '5.1', msg_type: 'display_data', username: 'rgbkrk', session: '123' }, metadata: {}, parent_header: {}, content: { data: { 'text/html': 'sup' }, metadata: {}, transient: {} } }
Convert from the object based jupyter message to raw message frames
Creates an error message to indicate when an exception has occurred during code execution.
http://jupyter-client.readthedocs.io/en/stable/messaging.html#execution-errors
Creates a message containing the response from a kernel execute request.
http://jupyter-client.readthedocs.io/en/stable/messaging.html#execution-results
An execute request creator
executeRequest('print("hey")', { 'silent': true }) { header: { msg_id: 'f344cc6b-4308-4405-a8e8-a166b0345579', date: 2017-10-23T22:33:39.970Z, version: '5.0', msg_type: 'execute_request', username: 'kyle', session: '123' }, metadata: {}, parent_header: {}, content: { code: 'print("hey")', silent: false, store_history: true, user_expressions: {}, allow_stdin: true, stop_on_error: false } }
The code to execute
The options for the execute request
A complete execute_request message
Creates a message containing information about the result of an execution.
http://jupyter-client.readthedocs.io/en/stable/messaging.html#id6
Get all the execution counts from an observable of jupyter messages
Convert from Pythonic HMAC scheme string to node.js compatible name.
Only support sha256 at the moment, which is all Jupyter uses nowadays anyhow.
Examples: "hmac-sha256", "sha256"
Creates a message to request information about a kernel.
A kernel_info_request message
Get all statuses of all running kernels.
Returns a fully-formatted kernel message.
An object containing the message type and session information
The message type-specific contents to send in the kernel message
The fully-formatted kernel message
ofMessageType is an Rx Operator that filters on msg.header.msg_type being one of messageTypes.
The message types to filter on
An Observable containing only messages of the specified types
Convert raw Jupyter messages that are output messages into nbformat style outputs
o$ = iopub$.pipe( childOf(originalMessage), outputs() )
Get all the payload message content from an observable of jupyter messages
p$ = shell$.pipe( childOf(originalMessage), payloads() )
Creates a message to request the shutdown of a kernel.
An options object containing whether or not to restart the kernel
A shutdown_request message
Creates a status message published by the kernel to indicate its state.
The kernel's execution state
Creates a stream message.
http://jupyter-client.readthedocs.io/en/stable/messaging.html#streams-stdout-stderr-etc
The message type and its contents.
Creates an update_display_data message.
http://jupyter-client.readthedocs.io/en/stable/messaging.html#update-display-data
Get all messages for updating a display output.
Returns which channel, iopub or stdin or shell, to send a kernel message through.
The message type to fetch a channel for
The channel to send a kernel message through
operator for getting all messages with the given comm id
The comm id that we are filtering by
A function that takes an Observable of kernel messages and returns messages that have the given comm id
Generated using TypeDoc
@nteract/messaging
This package contains type definitions and helper functions for interacting with the Jupyter Messaging Protocol. These functions can be used to create different types of request and response messages.
Installation
$ yarn add @nteract/messaging
$ npm install --save @nteract/messaging
Usage
The example below shows how we can use the
createMessage
function in this package to create an inspect_request Jupyter message.import { createMessage } from "@nteract/messaging";
const message = createMessage("inspect_request", { code: "string.for", cursor_pos: 10, detail_level: 1 });
Documentation
You can view the reference documentation for
@nteract/messaging
in the package docs.Support
If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the
pkg:messaging
label.License
BSD-3-Clause