sdkagent

jupyter_client API reference

194 public APIs from jupyter_client (jupyter/jupyter_client) — 36 classes, 33 functions, 125 methods. Signatures extracted by static analysis of the actual source.

Repository: jupyter/jupyter_client

KindCount
Classes36
Functions33
Methods125

API list

methodjupyter_client.adapter.Adapter.update_header(msg:dict[str, Any]) -> dict[str, Any]
Update the header.
methodjupyter_client.adapter.Adapter.update_metadata(msg:dict[str, Any]) -> dict[str, Any]
Update the metadata.
methodjupyter_client.adapter.Adapter.update_msg_type(msg:dict[str, Any]) -> dict[str, Any]
Update the message type.
classjupyter_client.adapter.V4toV5
Convert msg spec V4 to V5
methodjupyter_client.adapter.V4toV5.complete_reply(msg:dict[str, Any]) -> dict[str, Any]
Handle a complete reply.
methodjupyter_client.adapter.V4toV5.complete_request(msg:dict[str, Any]) -> dict[str, Any]
Handle a complete request.
methodjupyter_client.adapter.V4toV5.display_data(msg:dict[str, Any]) -> dict[str, Any]
Handle display data.
methodjupyter_client.adapter.V4toV5.execute_reply(msg:dict[str, Any]) -> dict[str, Any]
Handle an execute reply.
methodjupyter_client.adapter.V4toV5.execute_request(msg:dict[str, Any]) -> dict[str, Any]
Handle an execute request.
methodjupyter_client.adapter.V4toV5.input_request(msg:dict[str, Any]) -> dict[str, Any]
Handle an input request.
methodjupyter_client.adapter.V4toV5.inspect_reply(msg:dict[str, Any]) -> dict[str, Any]
inspect_reply can't be easily backward compatible
methodjupyter_client.adapter.V4toV5.inspect_request(msg:dict[str, Any]) -> dict[str, Any]
Handle an inspect request.
methodjupyter_client.adapter.V4toV5.kernel_info_reply(msg:dict[str, Any]) -> dict[str, Any]
Handle a kernel info reply.
methodjupyter_client.adapter.V4toV5.stream(msg:dict[str, Any]) -> dict[str, Any]
Handle a stream message.
methodjupyter_client.adapter.V4toV5.update_header(msg:dict[str, Any]) -> dict[str, Any]
Update the header.
classjupyter_client.adapter.V5toV4
Adapt msg protocol v5 to v4
methodjupyter_client.adapter.V5toV4.complete_reply(msg:dict[str, Any]) -> dict[str, Any]
Handle a complete reply.
methodjupyter_client.adapter.V5toV4.complete_request(msg:dict[str, Any]) -> dict[str, Any]
Handle a complete request.
methodjupyter_client.adapter.V5toV4.display_data(msg:dict[str, Any]) -> dict[str, Any]
Handle a display data message.
methodjupyter_client.adapter.V5toV4.execute_reply(msg:dict[str, Any]) -> dict[str, Any]
Handle an execute reply.
methodjupyter_client.adapter.V5toV4.execute_request(msg:dict[str, Any]) -> dict[str, Any]
Handle an execute request.
methodjupyter_client.adapter.V5toV4.input_request(msg:dict[str, Any]) -> dict[str, Any]
Handle an input request.
methodjupyter_client.adapter.V5toV4.kernel_info_reply(msg:dict[str, Any]) -> dict[str, Any]
Handle a kernel info reply.
methodjupyter_client.adapter.V5toV4.object_info_reply(msg:dict[str, Any]) -> dict[str, Any]
inspect_reply can't be easily backward compatible
methodjupyter_client.adapter.V5toV4.object_info_request(msg:dict[str, Any]) -> dict[str, Any]
Handle an object info request.
methodjupyter_client.adapter.V5toV4.stream(msg:dict[str, Any]) -> dict[str, Any]
Handle a stream message.
methodjupyter_client.adapter.V5toV4.update_header(msg:dict[str, Any]) -> dict[str, Any]
Update the header.
funcjupyter_client.asynchronous.client.wrapped(meth:t.Callable, channel:str) -> t.Callable
Wrap a method on a channel and handle replies.
funcjupyter_client.blocking.client.wrapped(meth:t.Callable, channel:str) -> t.Callable
Wrap a method on a channel and handle replies.
classjupyter_client.channels.AsyncZMQSocketChannel
A ZMQ socket in an async API
methodjupyter_client.channels.AsyncZMQSocketChannel.get_msg(timeout:float | None=None) -> t.Dict[str, t.Any]
Gets a message if there is one that is ready.
methodjupyter_client.channels.AsyncZMQSocketChannel.get_msgs() -> t.List[t.Dict[str, t.Any]]
Get all messages that are currently ready.
methodjupyter_client.channels.AsyncZMQSocketChannel.msg_ready() -> bool
Is there a message that has been received?
classjupyter_client.channels.HBChannel
The heartbeat channel which monitors the kernel heartbeat.
methodjupyter_client.channels.HBChannel.close() -> None
Close the heartbeat thread.
methodjupyter_client.channels.HBChannel.pause() -> None
Pause the heartbeat.
methodjupyter_client.channels.HBChannel.run() -> None
Run the heartbeat thread.
methodjupyter_client.channels.HBChannel.stop() -> None
Stop the channel's event loop and join its thread.
methodjupyter_client.channels.HBChannel.unpause() -> None
Unpause the heartbeat.
classjupyter_client.channels.InvalidPortNumber
An exception raised for an invalid port number.
classjupyter_client.channels.ZMQSocketChannel
A ZMQ socket wrapper
methodjupyter_client.channels.ZMQSocketChannel.close() -> None
Close the socket channel.
methodjupyter_client.channels.ZMQSocketChannel.get_msg(timeout:float | None=None) -> t.Dict[str, t.Any]
Gets a message if there is one that is ready.
methodjupyter_client.channels.ZMQSocketChannel.get_msgs() -> t.List[t.Dict[str, t.Any]]
Get all messages that are currently ready.
methodjupyter_client.channels.ZMQSocketChannel.is_alive() -> bool
Test whether the channel is alive.
methodjupyter_client.channels.ZMQSocketChannel.msg_ready() -> bool
Is there a message that has been received?
methodjupyter_client.channels.ZMQSocketChannel.send(msg:t.Dict[str, t.Any]) -> None
Pass a message to the ZMQ socket to send
methodjupyter_client.channels.ZMQSocketChannel.start() -> None
Start the socket channel.
classjupyter_client.channelsabc.ChannelABC
A base class for all channel ABCs.
methodjupyter_client.channelsabc.ChannelABC.is_alive() -> bool
Test whether the channel is alive.
methodjupyter_client.channelsabc.ChannelABC.start() -> None
Start the channel.
methodjupyter_client.channelsabc.ChannelABC.stop() -> None
Stop the channel.
classjupyter_client.channelsabc.HBChannelABC
HBChannel ABC.
methodjupyter_client.channelsabc.HBChannelABC.is_beating() -> bool
Test whether the channel is beating.
methodjupyter_client.channelsabc.HBChannelABC.pause() -> None
Pause the heartbeat channel.
methodjupyter_client.channelsabc.HBChannelABC.unpause() -> None
Unpause the heartbeat channel.
funcjupyter_client.client.validate_string_dict(dct:t.Dict[str, str]) -> None
Validate that the input is a dict with string keys and values.
classjupyter_client.clientabc.KernelClientABC
KernelManager ABC.
methodjupyter_client.clientabc.KernelClientABC.channels_running() -> bool
Get whether the channels are running.
methodjupyter_client.clientabc.KernelClientABC.start_channels(shell:bool=True, iopub:bool=True, stdin:bool=True, hb:bool=True, control:bool=True) -> None
Start the channels for the client.
methodjupyter_client.clientabc.KernelClientABC.stop_channels() -> None
Stop the channels for the client.
classjupyter_client.consoleapp.IPythonConsoleApp
An app to manage an ipython console.
classjupyter_client.consoleapp.JupyterConsoleApp
The base Jupyter console application.
methodjupyter_client.consoleapp.JupyterConsoleApp.init_kernel_client() -> None
Initialize the kernel client.
methodjupyter_client.consoleapp.JupyterConsoleApp.init_kernel_manager() -> None
Initialize the kernel manager.
methodjupyter_client.consoleapp.JupyterConsoleApp.init_ssh() -> None
set up ssh tunnels, if needed.
classjupyter_client.ioloop.manager.AsyncIOLoopKernelManager
An async ioloop kernel manager.
methodjupyter_client.ioloop.manager.AsyncIOLoopKernelManager.start_restarter() -> None
Start the restarter.
methodjupyter_client.ioloop.manager.AsyncIOLoopKernelManager.stop_restarter() -> None
Stop the restarter.
classjupyter_client.ioloop.manager.IOLoopKernelManager
An io loop kernel manager.
methodjupyter_client.ioloop.manager.IOLoopKernelManager.start_restarter() -> None
Start the restarter.
methodjupyter_client.ioloop.manager.IOLoopKernelManager.stop_restarter() -> None
Stop the restarter.
funcjupyter_client.ioloop.manager.as_zmqstream(f:t.Any) -> t.Callable
Convert a socket to a zmq stream.
classjupyter_client.ioloop.restarter.AsyncIOLoopKernelRestarter
An async io loop kernel restarter.
methodjupyter_client.ioloop.restarter.AsyncIOLoopKernelRestarter.poll() -> None
Poll the kernel.
classjupyter_client.ioloop.restarter.IOLoopKernelRestarter
Monitor and autorestart a kernel.
methodjupyter_client.ioloop.restarter.IOLoopKernelRestarter.start() -> None
Start the polling of the kernel.
methodjupyter_client.ioloop.restarter.IOLoopKernelRestarter.stop() -> None
Stop the kernel polling.
funcjupyter_client.jsonutil.date_default(obj:Any) -> Any
DEPRECATED: Use jupyter_client.jsonutil.json_default
funcjupyter_client.jsonutil.extract_dates(obj:Any) -> Any
extract ISO8601 dates from unpacked JSON
funcjupyter_client.jsonutil.json_default(obj:Any) -> Any
default function for packing objects in JSON.
funcjupyter_client.jsonutil.squash_dates(obj:Any) -> Any
squash datetime objects into ISO8601 strings
classjupyter_client.kernelapp.KernelApp
Launch a kernel by name in a local subprocess.
methodjupyter_client.kernelapp.KernelApp.initialize(argv:t.Union[str, t.Sequence[str], None]=None) -> None
Initialize the application.
methodjupyter_client.kernelapp.KernelApp.log_connection_info() -> None
Log the connection info for the kernel.
methodjupyter_client.kernelapp.KernelApp.setup_signals() -> None
Shutdown on SIGTERM or SIGINT (Ctrl-C)
methodjupyter_client.kernelapp.KernelApp.shutdown(signo:int) -> None
Shut down the application.
methodjupyter_client.kernelapp.KernelApp.start() -> None
Start the application.
classjupyter_client.kernelspec.KernelSpec
A kernel spec model object.
methodjupyter_client.kernelspec.KernelSpec.to_dict() -> dict[str, t.Any]
Convert the kernel spec to a dict.
methodjupyter_client.kernelspec.KernelSpec.to_json() -> str
Serialise this kernelspec to a JSON object.
classjupyter_client.kernelspec.KernelSpecManager
A manager for kernel specs.
methodjupyter_client.kernelspec.KernelSpecManager.get_all_specs() -> dict[str, t.Any]
Returns a dict mapping kernel names to kernelspecs.
methodjupyter_client.kernelspec.KernelSpecManager.get_kernel_spec(kernel_name:str) -> KernelSpec
Returns a :class:`KernelSpec` instance for the given kernel_name.
methodjupyter_client.kernelspec.KernelSpecManager.install_native_kernel_spec(user:bool=False) -> None
DEPRECATED: Use ipykernel.kernelspec.install
methodjupyter_client.kernelspec.KernelSpecManager.remove_kernel_spec(name:str) -> str
Remove a kernel spec directory by name.
classjupyter_client.kernelspec.NoSuchKernel
An error raised when there is no kernel of a give name.
funcjupyter_client.kernelspec.install_native_kernel_spec(user:bool=False) -> None
Install the native kernel spec.
classjupyter_client.kernelspecapp.InstallKernelSpec
An app to install a kernel spec.
methodjupyter_client.kernelspecapp.InstallKernelSpec.parse_command_line(argv:None | list[str]) -> None
Parse the command line args.
methodjupyter_client.kernelspecapp.InstallKernelSpec.start() -> None
Start the application.
classjupyter_client.kernelspecapp.InstallNativeKernelSpec
An app to install the native kernel spec.
methodjupyter_client.kernelspecapp.InstallNativeKernelSpec.start() -> None
Start the application.
classjupyter_client.kernelspecapp.KernelSpecApp
An app to manage kernel specs.
methodjupyter_client.kernelspecapp.KernelSpecApp.start() -> None
Start the application.
classjupyter_client.kernelspecapp.ListKernelSpecs
An app to list kernel specs.
funcjupyter_client.kernelspecapp.ListKernelSpecs.path_key(item:t.Any) -> t.Any
sort key function for Jupyter path priority
methodjupyter_client.kernelspecapp.ListKernelSpecs.start() -> dict[str, t.Any] | None
Start the application.
classjupyter_client.kernelspecapp.ListProvisioners
An app to list provisioners.
methodjupyter_client.kernelspecapp.ListProvisioners.start() -> None
Start the application.
classjupyter_client.kernelspecapp.RemoveKernelSpec
An app to remove a kernel spec.
methodjupyter_client.kernelspecapp.RemoveKernelSpec.parse_command_line(argv:list[str] | None) -> None
Parse the command line args.
methodjupyter_client.kernelspecapp.RemoveKernelSpec.start() -> None
Start the application.
funcjupyter_client.localinterfaces.is_local_ip(ip:str) -> bool
does `ip` point to this machine?
funcjupyter_client.localinterfaces.is_public_ip(ip:str) -> bool
is `ip` a publicly visible address?
funcjupyter_client.localinterfaces.local_ips() -> list[str]
return the IP addresses that point to this machine
funcjupyter_client.localinterfaces.localhost() -> str
return ip for localhost (almost always 127.0.0.1)
classjupyter_client.manager.AsyncKernelManager
An async kernel manager.
methodjupyter_client.manager.AsyncKernelManager.client(**kwargs:t.Any) -> AsyncKernelClient
Get a client for the manager.
classjupyter_client.manager.KernelManager
Manages a single kernel in a subprocess on this host.
methodjupyter_client.manager.KernelManager.client(**kwargs:t.Any) -> BlockingKernelClient
Create a client configured to connect to our kernel
methodjupyter_client.manager.KernelManager.format_kernel_cmd(extra_arguments:t.List[str] | None=None) -> t.List[str]
Replace templated args (e.g.
funcjupyter_client.manager.KernelManager.from_ns(match:t.Any) -> t.Any
Get the key out of ns if it's there, otherwise no change.
methodjupyter_client.manager.KernelManager.resolve_path(path:str) -> str | None
Resolve path to given file.
methodjupyter_client.manager.KernelManager.start_restarter() -> None
Start the kernel restarter.
methodjupyter_client.manager.KernelManager.stop_restarter() -> None
Stop the kernel restarter.
methodjupyter_client.manager.KernelManager.update_env(*env:t.Dict[str, str]) -> None
Allow to update the environment of a kernel manager.
funcjupyter_client.manager.run_kernel(**kwargs:t.Any) -> t.Iterator[KernelClient]
Context manager to create a kernel in a subprocess.
funcjupyter_client.manager.wrapper(self:t.Any, *args:t.Any, **kwargs:t.Any) -> t.Any
Create a future for the decorated method.
classjupyter_client.managerabc.KernelManagerABC
KernelManager ABC.
methodjupyter_client.managerabc.KernelManagerABC.interrupt_kernel() -> None
Interrupt the kernel.
methodjupyter_client.managerabc.KernelManagerABC.is_alive() -> bool
Test whether the kernel is alive.
methodjupyter_client.managerabc.KernelManagerABC.restart_kernel(now:bool=False, **kw:Any) -> None
Restart the kernel.
methodjupyter_client.managerabc.KernelManagerABC.shutdown_kernel(now:bool=False, restart:bool=False) -> None
Shut down the kernel.
methodjupyter_client.managerabc.KernelManagerABC.signal_kernel(signum:int) -> None
Send a signal to the kernel.
methodjupyter_client.managerabc.KernelManagerABC.start_kernel(**kw:Any) -> None
Start the kernel.
classjupyter_client.multikernelmanager.MultiKernelManager
A class for managing multiple kernels.
methodjupyter_client.multikernelmanager.MultiKernelManager.add_restart_callback(kernel_id:str, callback:t.Callable, event:str='restart') -> None
add a callback for the KernelRestarter
methodjupyter_client.multikernelmanager.MultiKernelManager.cleanup_resources(kernel_id:str, restart:bool=False) -> None
Clean up a kernel's resources
methodjupyter_client.multikernelmanager.MultiKernelManager.connect_hb(kernel_id:str, identity:bytes | None=None) -> socket.socket
Return a zmq Socket connected to the hb channel.
methodjupyter_client.multikernelmanager.MultiKernelManager.interrupt_kernel(kernel_id:str) -> None
Interrupt (SIGINT) the kernel by its uuid.
methodjupyter_client.multikernelmanager.MultiKernelManager.is_alive(kernel_id:str) -> bool
Is the kernel alive.
methodjupyter_client.multikernelmanager.MultiKernelManager.remove_kernel(kernel_id:str) -> KernelManager
remove a kernel from our mapping.
methodjupyter_client.multikernelmanager.MultiKernelManager.remove_restart_callback(kernel_id:str, callback:t.Callable, event:str='restart') -> None
remove a callback for the KernelRestarter
methodjupyter_client.multikernelmanager.MultiKernelManager.request_shutdown(kernel_id:str, restart:bool | None=False) -> None
Ask a kernel to shut down by its kernel uuid
methodjupyter_client.multikernelmanager.MultiKernelManager.signal_kernel(kernel_id:str, signum:int) -> None
Sends a signal to the kernel by its uuid.
methodjupyter_client.multikernelmanager.MultiKernelManager.update_env(*kernel_id:str, *env:t.Dict[str, str]) -> None
Allow to update the environment of the given kernel.
classjupyter_client.restarter.KernelRestarter
Monitor and autorestart a kernel.
methodjupyter_client.restarter.KernelRestarter.start() -> None
Start the polling of the kernel.
methodjupyter_client.restarter.KernelRestarter.stop() -> None
Stop the kernel polling.
classjupyter_client.runapp.RunApp
An Jupyter Console app to run files.
methodjupyter_client.runapp.RunApp.handle_sigint(*args:t.Any) -> None
Handle SIGINT.
methodjupyter_client.runapp.RunApp.initialize(argv:list[str] | None=None) -> None
Initialize the app.
methodjupyter_client.runapp.RunApp.parse_command_line(argv:list[str] | None=None) -> None
Parse the command line arguments.
methodjupyter_client.runapp.RunApp.start() -> None
Start the application.
classjupyter_client.session.Message
A simple message object that maps dict keys to attributes.
classjupyter_client.session.Session
Object for handling serialization and sending of messages.
methodjupyter_client.session.Session.deserialize(msg_list:list[bytes] | list[zmq.Message], content:bool=True, copy:bool=True) -> dict[str, t.Any]
Unserialize a msg_list to a nested message dict.
methodjupyter_client.session.Session.msg(msg_type:str, content:dict | None=None, parent:dict[str, t.Any] | None=None, header:dict[str, t.Any] | None=None, metadata:dict[str, t.Any] | None=None) -> dict[str, t.Any]
Return the nested message dict.
methodjupyter_client.session.Session.msg_header(msg_type:str) -> dict[str, t.Any]
Create a header for a message type.
methodjupyter_client.session.Session.recv(socket:zmq.sugar.socket.Socket, mode:int=zmq.NOBLOCK, content:bool=True, copy:bool=True) -> tuple[list[bytes] | None, dict[str, t.Any] | None]
Receive and unpack a message.
methodjupyter_client.session.Session.send_raw(stream:zmq.sugar.socket.Socket, msg_list:list, flags:int=0, copy:bool=True, ident:bytes | list[bytes] | None=None) -> None
Send a raw message via ident path.
methodjupyter_client.session.Session.serialize(msg:dict[str, t.Any], ident:list[bytes] | bytes | None=None) -> list[bytes]
Serialize the message components to bytes.
methodjupyter_client.session.Session.sign(msg_list:list) -> bytes
Sign a message with HMAC digest.
methodjupyter_client.session.Session.unserialize(*args:t.Any, **kwargs:t.Any) -> dict[str, t.Any]
**DEPRECATED** Use deserialize instead.
funcjupyter_client.session.default_secure(cfg:t.Any) -> None
Set the default behavior for a config environment to be secure.
funcjupyter_client.session.extract_header(msg_or_header:dict[str, t.Any]) -> dict[str, t.Any]
Given a message or header, return the header.
funcjupyter_client.session.json_packer(obj:t.Any) -> bytes
Convert a json object to a bytes.
funcjupyter_client.session.json_unpacker(s:str | bytes) -> t.Any
Convert a json bytes or string to an object.
funcjupyter_client.session.msg_header(msg_id:str, msg_type:str, username:str, session:Session | str) -> dict[str, t.Any]
Create a new message header
funcjupyter_client.session.new_id() -> str
Generate a new random id.
funcjupyter_client.session.new_id_bytes() -> bytes
Return new_id as ascii bytes
funcjupyter_client.session.pickle_packer(o:t.Any) -> bytes
Pack an object using the pickle module.
funcjupyter_client.session.squash_unicode(obj:t.Any) -> t.Any
coerce unicode back to bytestrings.
funcjupyter_client.session.utcnow() -> datetime
Return timezone-aware UTC timestamp
classjupyter_client.ssh.forward.ForwardServer
A server to use for ssh forwarding.
classjupyter_client.ssh.forward.Handler
A handle for server requests.
methodjupyter_client.ssh.forward.Handler.handle()
Handle a request.
funcjupyter_client.ssh.forward.forward_tunnel(local_port:int, remote_host:str, remote_port:int, transport:t.Any) -> None
Forward an ssh tunnel.
funcjupyter_client.ssh.tunnel.open_tunnel(addr:str, server:str, keyfile:str | None=None, password:str | None=None, paramiko:Any=None, timeout:int=60) -> tuple[str, int]
Open a tunneled connection from a 0MQ url.
funcjupyter_client.ssh.tunnel.select_random_ports(n:int) -> list[int]
Select and return n random ports that are available.
funcjupyter_client.ssh.tunnel.try_passwordless_ssh(server:str, keyfile:str | None, paramiko:Any=None) -> Any
Attempt to make an ssh connection without a password.
methodjupyter_client.threaded.IOLoopThread.close() -> None
Close the io loop thread.
methodjupyter_client.threaded.IOLoopThread.run() -> None
Run my loop, ignoring EINTR events in the poller
methodjupyter_client.threaded.IOLoopThread.stop() -> None
Stop the channel's event loop and join its thread.
classjupyter_client.threaded.ThreadedZMQSocketChannel
A ZMQ socket invoking a callback in the ioloop
methodjupyter_client.threaded.ThreadedZMQSocketChannel.close() -> None
Close the channel.
methodjupyter_client.threaded.ThreadedZMQSocketChannel.flush(timeout:float=1.0) -> None
Immediately processes all pending messages on this channel.
methodjupyter_client.threaded.ThreadedZMQSocketChannel.is_alive() -> bool
Whether the channel is alive.
methodjupyter_client.threaded.ThreadedZMQSocketChannel.send(msg:dict[str, Any]) -> None
Queue a message to be sent from the IOLoop's thread.
methodjupyter_client.threaded.ThreadedZMQSocketChannel.start() -> None
Start the channel.
methodjupyter_client.threaded.ThreadedZMQSocketChannel.stop() -> None
Stop the channel.
funcjupyter_client.win_interrupt.create_interrupt_event() -> Any
Create an interrupt event handle.
funcjupyter_client.win_interrupt.send_interrupt(interrupt_handle:Any) -> None
Sends an interrupt event using the specified handle.

About this data

These signatures were extracted from the public source of jupyter/jupyter_client using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries