Jupyter Kernel (xonsh.jupyter_kernel)

Hooks for Jupyter Xonsh Kernel.

class xonsh.jupyter_kernel.XonshKernel(debug_level=0, session_id=None, config=None, **kwargs)[source]

Xonsh xernal for Jupyter

debug_levelint, optional

Integer from 0 (no debugging) to 3 (all debugging), default: 0.

session_idstr or None, optional

Unique string id representing the kernel session. If None, this will be replaced with a random UUID.

configdict or None, optional

Configuration dictionary to start server with. BY default will search the command line for options (if given) or use default configuration.

control_handler(self, wire_message)[source]

Handles control requests

deserialize_wire_message(self, wire_message)[source]

Split the routing prefix and message frames from a message on the wire

do_complete(self, code, pos)[source]

Get completions.

do_execute(self, code='', silent=False, store_history=True, user_expressions=None, allow_stdin=False, parent_header=None, **kwargs)[source]

Execute user code.

dprint(self, level, *args, **kwargs)[source]

Print but with debug information.

handle_complete_request(self, message, identities)[source]

Handles kernel info requests.

handle_execute_request(self, message, identities)[source]

Handle execute request messages.

handle_kernel_info_request(self, message, identities)[source]

Handles kernel info requests.


Run heartbeat

iopub_handler(self, message)[source]

Handles iopub requests.


Provides default configuration

new_header(self, message_type)[source]

Make a new header

run_thread(self, loop, name)[source]

Run main thread

send(self, stream, message_type, content=None, parent_header=None, metadata=None, identities=None)[source]

Send data to the client via a stream

shell_handler(self, message)[source]

Dispatch shell messages to their handlers


Shutsdown the kernel

sign(self, messages)[source]

Sign a message list with a secure signature.


Starts the server

stdin_handler(self, message)[source]
banner = 'Xonsh - Python-powered, cross-platform shell'
implementation = 'Xonsh 0.8.12'
implementation_version = '0.8.12'
language = 'xonsh'
language_info = {'codemirror_mode': 'shell', 'file_extension': '.xsh', 'mimetype': 'text/x-sh', 'name': 'xonsh', 'pygments_lexer': 'xonsh', 'version': '0.8.12'}
language_version = ['0', '8', '12']
signature_schemes = {'hmac-sha256': <built-in function openssl_sha256>}
xonsh.jupyter_kernel.bind(socket, connection, port)[source]

Binds a socket to a port, or a random port if needed. Returns the port.

xonsh.jupyter_kernel.dump_bytes(*args, **kwargs)[source]

Converts an object to JSON and returns the bytes.


Converts bytes of JSON to an object.