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
| Kind | Count |
|---|---|
| Classes | 36 |
| Functions | 33 |
| Methods | 125 |
API list
method
jupyter_client.adapter.Adapter.update_header(msg:dict[str, Any]) -> dict[str, Any]Update the header.
method
jupyter_client.adapter.Adapter.update_metadata(msg:dict[str, Any]) -> dict[str, Any]Update the metadata.
method
jupyter_client.adapter.Adapter.update_msg_type(msg:dict[str, Any]) -> dict[str, Any]Update the message type.
class
jupyter_client.adapter.V4toV5Convert msg spec V4 to V5
method
jupyter_client.adapter.V4toV5.complete_reply(msg:dict[str, Any]) -> dict[str, Any]Handle a complete reply.
method
jupyter_client.adapter.V4toV5.complete_request(msg:dict[str, Any]) -> dict[str, Any]Handle a complete request.
method
jupyter_client.adapter.V4toV5.display_data(msg:dict[str, Any]) -> dict[str, Any]Handle display data.
method
jupyter_client.adapter.V4toV5.execute_reply(msg:dict[str, Any]) -> dict[str, Any]Handle an execute reply.
method
jupyter_client.adapter.V4toV5.execute_request(msg:dict[str, Any]) -> dict[str, Any]Handle an execute request.
method
jupyter_client.adapter.V4toV5.input_request(msg:dict[str, Any]) -> dict[str, Any]Handle an input request.
method
jupyter_client.adapter.V4toV5.inspect_reply(msg:dict[str, Any]) -> dict[str, Any]inspect_reply can't be easily backward compatible
method
jupyter_client.adapter.V4toV5.inspect_request(msg:dict[str, Any]) -> dict[str, Any]Handle an inspect request.
method
jupyter_client.adapter.V4toV5.kernel_info_reply(msg:dict[str, Any]) -> dict[str, Any]Handle a kernel info reply.
method
jupyter_client.adapter.V4toV5.stream(msg:dict[str, Any]) -> dict[str, Any]Handle a stream message.
method
jupyter_client.adapter.V4toV5.update_header(msg:dict[str, Any]) -> dict[str, Any]Update the header.
class
jupyter_client.adapter.V5toV4Adapt msg protocol v5 to v4
method
jupyter_client.adapter.V5toV4.complete_reply(msg:dict[str, Any]) -> dict[str, Any]Handle a complete reply.
method
jupyter_client.adapter.V5toV4.complete_request(msg:dict[str, Any]) -> dict[str, Any]Handle a complete request.
method
jupyter_client.adapter.V5toV4.display_data(msg:dict[str, Any]) -> dict[str, Any]Handle a display data message.
method
jupyter_client.adapter.V5toV4.execute_reply(msg:dict[str, Any]) -> dict[str, Any]Handle an execute reply.
method
jupyter_client.adapter.V5toV4.execute_request(msg:dict[str, Any]) -> dict[str, Any]Handle an execute request.
method
jupyter_client.adapter.V5toV4.input_request(msg:dict[str, Any]) -> dict[str, Any]Handle an input request.
method
jupyter_client.adapter.V5toV4.kernel_info_reply(msg:dict[str, Any]) -> dict[str, Any]Handle a kernel info reply.
method
jupyter_client.adapter.V5toV4.object_info_reply(msg:dict[str, Any]) -> dict[str, Any]inspect_reply can't be easily backward compatible
method
jupyter_client.adapter.V5toV4.object_info_request(msg:dict[str, Any]) -> dict[str, Any]Handle an object info request.
method
jupyter_client.adapter.V5toV4.stream(msg:dict[str, Any]) -> dict[str, Any]Handle a stream message.
method
jupyter_client.adapter.V5toV4.update_header(msg:dict[str, Any]) -> dict[str, Any]Update the header.
func
jupyter_client.asynchronous.client.wrapped(meth:t.Callable, channel:str) -> t.CallableWrap a method on a channel and handle replies.
func
jupyter_client.blocking.client.wrapped(meth:t.Callable, channel:str) -> t.CallableWrap a method on a channel and handle replies.
class
jupyter_client.channels.AsyncZMQSocketChannelA ZMQ socket in an async API
method
jupyter_client.channels.AsyncZMQSocketChannel.get_msg(timeout:float | None=None) -> t.Dict[str, t.Any]Gets a message if there is one that is ready.
method
jupyter_client.channels.AsyncZMQSocketChannel.get_msgs() -> t.List[t.Dict[str, t.Any]]Get all messages that are currently ready.
method
jupyter_client.channels.AsyncZMQSocketChannel.msg_ready() -> boolIs there a message that has been received?
class
jupyter_client.channels.HBChannelThe heartbeat channel which monitors the kernel heartbeat.
method
jupyter_client.channels.HBChannel.close() -> NoneClose the heartbeat thread.
method
jupyter_client.channels.HBChannel.pause() -> NonePause the heartbeat.
method
jupyter_client.channels.HBChannel.run() -> NoneRun the heartbeat thread.
method
jupyter_client.channels.HBChannel.stop() -> NoneStop the channel's event loop and join its thread.
method
jupyter_client.channels.HBChannel.unpause() -> NoneUnpause the heartbeat.
class
jupyter_client.channels.InvalidPortNumberAn exception raised for an invalid port number.
class
jupyter_client.channels.ZMQSocketChannelA ZMQ socket wrapper
method
jupyter_client.channels.ZMQSocketChannel.close() -> NoneClose the socket channel.
method
jupyter_client.channels.ZMQSocketChannel.get_msg(timeout:float | None=None) -> t.Dict[str, t.Any]Gets a message if there is one that is ready.
method
jupyter_client.channels.ZMQSocketChannel.get_msgs() -> t.List[t.Dict[str, t.Any]]Get all messages that are currently ready.
method
jupyter_client.channels.ZMQSocketChannel.is_alive() -> boolTest whether the channel is alive.
method
jupyter_client.channels.ZMQSocketChannel.msg_ready() -> boolIs there a message that has been received?
method
jupyter_client.channels.ZMQSocketChannel.send(msg:t.Dict[str, t.Any]) -> NonePass a message to the ZMQ socket to send
method
jupyter_client.channels.ZMQSocketChannel.start() -> NoneStart the socket channel.
class
jupyter_client.channelsabc.ChannelABCA base class for all channel ABCs.
method
jupyter_client.channelsabc.ChannelABC.is_alive() -> boolTest whether the channel is alive.
method
jupyter_client.channelsabc.ChannelABC.start() -> NoneStart the channel.
method
jupyter_client.channelsabc.ChannelABC.stop() -> NoneStop the channel.
class
jupyter_client.channelsabc.HBChannelABCHBChannel ABC.
method
jupyter_client.channelsabc.HBChannelABC.is_beating() -> boolTest whether the channel is beating.
method
jupyter_client.channelsabc.HBChannelABC.pause() -> NonePause the heartbeat channel.
method
jupyter_client.channelsabc.HBChannelABC.unpause() -> NoneUnpause the heartbeat channel.
func
jupyter_client.client.validate_string_dict(dct:t.Dict[str, str]) -> NoneValidate that the input is a dict with string keys and values.
class
jupyter_client.clientabc.KernelClientABCKernelManager ABC.
method
jupyter_client.clientabc.KernelClientABC.channels_running() -> boolGet whether the channels are running.
method
jupyter_client.clientabc.KernelClientABC.start_channels(shell:bool=True, iopub:bool=True, stdin:bool=True, hb:bool=True, control:bool=True) -> NoneStart the channels for the client.
method
jupyter_client.clientabc.KernelClientABC.stop_channels() -> NoneStop the channels for the client.
class
jupyter_client.consoleapp.IPythonConsoleAppAn app to manage an ipython console.
class
jupyter_client.consoleapp.JupyterConsoleAppThe base Jupyter console application.
method
jupyter_client.consoleapp.JupyterConsoleApp.init_kernel_client() -> NoneInitialize the kernel client.
method
jupyter_client.consoleapp.JupyterConsoleApp.init_kernel_manager() -> NoneInitialize the kernel manager.
method
jupyter_client.consoleapp.JupyterConsoleApp.init_ssh() -> Noneset up ssh tunnels, if needed.
class
jupyter_client.ioloop.manager.AsyncIOLoopKernelManagerAn async ioloop kernel manager.
method
jupyter_client.ioloop.manager.AsyncIOLoopKernelManager.start_restarter() -> NoneStart the restarter.
method
jupyter_client.ioloop.manager.AsyncIOLoopKernelManager.stop_restarter() -> NoneStop the restarter.
class
jupyter_client.ioloop.manager.IOLoopKernelManagerAn io loop kernel manager.
method
jupyter_client.ioloop.manager.IOLoopKernelManager.start_restarter() -> NoneStart the restarter.
method
jupyter_client.ioloop.manager.IOLoopKernelManager.stop_restarter() -> NoneStop the restarter.
func
jupyter_client.ioloop.manager.as_zmqstream(f:t.Any) -> t.CallableConvert a socket to a zmq stream.
class
jupyter_client.ioloop.restarter.AsyncIOLoopKernelRestarterAn async io loop kernel restarter.
method
jupyter_client.ioloop.restarter.AsyncIOLoopKernelRestarter.poll() -> NonePoll the kernel.
class
jupyter_client.ioloop.restarter.IOLoopKernelRestarterMonitor and autorestart a kernel.
method
jupyter_client.ioloop.restarter.IOLoopKernelRestarter.start() -> NoneStart the polling of the kernel.
method
jupyter_client.ioloop.restarter.IOLoopKernelRestarter.stop() -> NoneStop the kernel polling.
func
jupyter_client.jsonutil.date_default(obj:Any) -> AnyDEPRECATED: Use jupyter_client.jsonutil.json_default
func
jupyter_client.jsonutil.extract_dates(obj:Any) -> Anyextract ISO8601 dates from unpacked JSON
func
jupyter_client.jsonutil.json_default(obj:Any) -> Anydefault function for packing objects in JSON.
func
jupyter_client.jsonutil.squash_dates(obj:Any) -> Anysquash datetime objects into ISO8601 strings
class
jupyter_client.kernelapp.KernelAppLaunch a kernel by name in a local subprocess.
method
jupyter_client.kernelapp.KernelApp.initialize(argv:t.Union[str, t.Sequence[str], None]=None) -> NoneInitialize the application.
method
jupyter_client.kernelapp.KernelApp.log_connection_info() -> NoneLog the connection info for the kernel.
method
jupyter_client.kernelapp.KernelApp.setup_signals() -> NoneShutdown on SIGTERM or SIGINT (Ctrl-C)
method
jupyter_client.kernelapp.KernelApp.shutdown(signo:int) -> NoneShut down the application.
method
jupyter_client.kernelapp.KernelApp.start() -> NoneStart the application.
class
jupyter_client.kernelspec.KernelSpecA kernel spec model object.
method
jupyter_client.kernelspec.KernelSpec.to_dict() -> dict[str, t.Any]Convert the kernel spec to a dict.
method
jupyter_client.kernelspec.KernelSpec.to_json() -> strSerialise this kernelspec to a JSON object.
class
jupyter_client.kernelspec.KernelSpecManagerA manager for kernel specs.
method
jupyter_client.kernelspec.KernelSpecManager.get_all_specs() -> dict[str, t.Any]Returns a dict mapping kernel names to kernelspecs.
method
jupyter_client.kernelspec.KernelSpecManager.get_kernel_spec(kernel_name:str) -> KernelSpecReturns a :class:`KernelSpec` instance for the given kernel_name.
method
jupyter_client.kernelspec.KernelSpecManager.install_native_kernel_spec(user:bool=False) -> NoneDEPRECATED: Use ipykernel.kernelspec.install
method
jupyter_client.kernelspec.KernelSpecManager.remove_kernel_spec(name:str) -> strRemove a kernel spec directory by name.
class
jupyter_client.kernelspec.NoSuchKernelAn error raised when there is no kernel of a give name.
func
jupyter_client.kernelspec.install_native_kernel_spec(user:bool=False) -> NoneInstall the native kernel spec.
class
jupyter_client.kernelspecapp.InstallKernelSpecAn app to install a kernel spec.
method
jupyter_client.kernelspecapp.InstallKernelSpec.parse_command_line(argv:None | list[str]) -> NoneParse the command line args.
method
jupyter_client.kernelspecapp.InstallKernelSpec.start() -> NoneStart the application.
class
jupyter_client.kernelspecapp.InstallNativeKernelSpecAn app to install the native kernel spec.
method
jupyter_client.kernelspecapp.InstallNativeKernelSpec.start() -> NoneStart the application.
class
jupyter_client.kernelspecapp.KernelSpecAppAn app to manage kernel specs.
method
jupyter_client.kernelspecapp.KernelSpecApp.start() -> NoneStart the application.
class
jupyter_client.kernelspecapp.ListKernelSpecsAn app to list kernel specs.
func
jupyter_client.kernelspecapp.ListKernelSpecs.path_key(item:t.Any) -> t.Anysort key function for Jupyter path priority
method
jupyter_client.kernelspecapp.ListKernelSpecs.start() -> dict[str, t.Any] | NoneStart the application.
class
jupyter_client.kernelspecapp.ListProvisionersAn app to list provisioners.
method
jupyter_client.kernelspecapp.ListProvisioners.start() -> NoneStart the application.
class
jupyter_client.kernelspecapp.RemoveKernelSpecAn app to remove a kernel spec.
method
jupyter_client.kernelspecapp.RemoveKernelSpec.parse_command_line(argv:list[str] | None) -> NoneParse the command line args.
method
jupyter_client.kernelspecapp.RemoveKernelSpec.start() -> NoneStart the application.
func
jupyter_client.localinterfaces.is_local_ip(ip:str) -> booldoes `ip` point to this machine?
func
jupyter_client.localinterfaces.is_public_ip(ip:str) -> boolis `ip` a publicly visible address?
func
jupyter_client.localinterfaces.local_ips() -> list[str]return the IP addresses that point to this machine
func
jupyter_client.localinterfaces.localhost() -> strreturn ip for localhost (almost always 127.0.0.1)
class
jupyter_client.manager.AsyncKernelManagerAn async kernel manager.
method
jupyter_client.manager.AsyncKernelManager.client(**kwargs:t.Any) -> AsyncKernelClientGet a client for the manager.
class
jupyter_client.manager.KernelManagerManages a single kernel in a subprocess on this host.
method
jupyter_client.manager.KernelManager.client(**kwargs:t.Any) -> BlockingKernelClientCreate a client configured to connect to our kernel
method
jupyter_client.manager.KernelManager.format_kernel_cmd(extra_arguments:t.List[str] | None=None) -> t.List[str]Replace templated args (e.g.
func
jupyter_client.manager.KernelManager.from_ns(match:t.Any) -> t.AnyGet the key out of ns if it's there, otherwise no change.
method
jupyter_client.manager.KernelManager.resolve_path(path:str) -> str | NoneResolve path to given file.
method
jupyter_client.manager.KernelManager.start_restarter() -> NoneStart the kernel restarter.
method
jupyter_client.manager.KernelManager.stop_restarter() -> NoneStop the kernel restarter.
method
jupyter_client.manager.KernelManager.update_env(*env:t.Dict[str, str]) -> NoneAllow to update the environment of a kernel manager.
func
jupyter_client.manager.run_kernel(**kwargs:t.Any) -> t.Iterator[KernelClient]Context manager to create a kernel in a subprocess.
func
jupyter_client.manager.wrapper(self:t.Any, *args:t.Any, **kwargs:t.Any) -> t.AnyCreate a future for the decorated method.
class
jupyter_client.managerabc.KernelManagerABCKernelManager ABC.
method
jupyter_client.managerabc.KernelManagerABC.interrupt_kernel() -> NoneInterrupt the kernel.
method
jupyter_client.managerabc.KernelManagerABC.is_alive() -> boolTest whether the kernel is alive.
method
jupyter_client.managerabc.KernelManagerABC.restart_kernel(now:bool=False, **kw:Any) -> NoneRestart the kernel.
method
jupyter_client.managerabc.KernelManagerABC.shutdown_kernel(now:bool=False, restart:bool=False) -> NoneShut down the kernel.
method
jupyter_client.managerabc.KernelManagerABC.signal_kernel(signum:int) -> NoneSend a signal to the kernel.
method
jupyter_client.managerabc.KernelManagerABC.start_kernel(**kw:Any) -> NoneStart the kernel.
class
jupyter_client.multikernelmanager.MultiKernelManagerA class for managing multiple kernels.
method
jupyter_client.multikernelmanager.MultiKernelManager.add_restart_callback(kernel_id:str, callback:t.Callable, event:str='restart') -> Noneadd a callback for the KernelRestarter
method
jupyter_client.multikernelmanager.MultiKernelManager.cleanup_resources(kernel_id:str, restart:bool=False) -> NoneClean up a kernel's resources
method
jupyter_client.multikernelmanager.MultiKernelManager.connect_hb(kernel_id:str, identity:bytes | None=None) -> socket.socketReturn a zmq Socket connected to the hb channel.
method
jupyter_client.multikernelmanager.MultiKernelManager.interrupt_kernel(kernel_id:str) -> NoneInterrupt (SIGINT) the kernel by its uuid.
method
jupyter_client.multikernelmanager.MultiKernelManager.is_alive(kernel_id:str) -> boolIs the kernel alive.
method
jupyter_client.multikernelmanager.MultiKernelManager.remove_kernel(kernel_id:str) -> KernelManagerremove a kernel from our mapping.
method
jupyter_client.multikernelmanager.MultiKernelManager.remove_restart_callback(kernel_id:str, callback:t.Callable, event:str='restart') -> Noneremove a callback for the KernelRestarter
method
jupyter_client.multikernelmanager.MultiKernelManager.request_shutdown(kernel_id:str, restart:bool | None=False) -> NoneAsk a kernel to shut down by its kernel uuid
method
jupyter_client.multikernelmanager.MultiKernelManager.signal_kernel(kernel_id:str, signum:int) -> NoneSends a signal to the kernel by its uuid.
method
jupyter_client.multikernelmanager.MultiKernelManager.update_env(*kernel_id:str, *env:t.Dict[str, str]) -> NoneAllow to update the environment of the given kernel.
class
jupyter_client.restarter.KernelRestarterMonitor and autorestart a kernel.
method
jupyter_client.restarter.KernelRestarter.start() -> NoneStart the polling of the kernel.
method
jupyter_client.restarter.KernelRestarter.stop() -> NoneStop the kernel polling.
class
jupyter_client.runapp.RunAppAn Jupyter Console app to run files.
method
jupyter_client.runapp.RunApp.handle_sigint(*args:t.Any) -> NoneHandle SIGINT.
method
jupyter_client.runapp.RunApp.initialize(argv:list[str] | None=None) -> NoneInitialize the app.
method
jupyter_client.runapp.RunApp.parse_command_line(argv:list[str] | None=None) -> NoneParse the command line arguments.
method
jupyter_client.runapp.RunApp.start() -> NoneStart the application.
class
jupyter_client.session.MessageA simple message object that maps dict keys to attributes.
class
jupyter_client.session.SessionObject for handling serialization and sending of messages.
method
jupyter_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.
method
jupyter_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.
method
jupyter_client.session.Session.msg_header(msg_type:str) -> dict[str, t.Any]Create a header for a message type.
method
jupyter_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.
method
jupyter_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) -> NoneSend a raw message via ident path.
method
jupyter_client.session.Session.serialize(msg:dict[str, t.Any], ident:list[bytes] | bytes | None=None) -> list[bytes]Serialize the message components to bytes.
method
jupyter_client.session.Session.sign(msg_list:list) -> bytesSign a message with HMAC digest.
method
jupyter_client.session.Session.unserialize(*args:t.Any, **kwargs:t.Any) -> dict[str, t.Any]**DEPRECATED** Use deserialize instead.
func
jupyter_client.session.default_secure(cfg:t.Any) -> NoneSet the default behavior for a config environment to be secure.
func
jupyter_client.session.extract_header(msg_or_header:dict[str, t.Any]) -> dict[str, t.Any]Given a message or header, return the header.
func
jupyter_client.session.json_packer(obj:t.Any) -> bytesConvert a json object to a bytes.
func
jupyter_client.session.json_unpacker(s:str | bytes) -> t.AnyConvert a json bytes or string to an object.
func
jupyter_client.session.msg_header(msg_id:str, msg_type:str, username:str, session:Session | str) -> dict[str, t.Any]Create a new message header
func
jupyter_client.session.new_id() -> strGenerate a new random id.
func
jupyter_client.session.new_id_bytes() -> bytesReturn new_id as ascii bytes
func
jupyter_client.session.pickle_packer(o:t.Any) -> bytesPack an object using the pickle module.
func
jupyter_client.session.squash_unicode(obj:t.Any) -> t.Anycoerce unicode back to bytestrings.
func
jupyter_client.session.utcnow() -> datetimeReturn timezone-aware UTC timestamp
class
jupyter_client.ssh.forward.ForwardServerA server to use for ssh forwarding.
class
jupyter_client.ssh.forward.HandlerA handle for server requests.
method
jupyter_client.ssh.forward.Handler.handle()Handle a request.
func
jupyter_client.ssh.forward.forward_tunnel(local_port:int, remote_host:str, remote_port:int, transport:t.Any) -> NoneForward an ssh tunnel.
func
jupyter_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.
func
jupyter_client.ssh.tunnel.select_random_ports(n:int) -> list[int]Select and return n random ports that are available.
func
jupyter_client.ssh.tunnel.try_passwordless_ssh(server:str, keyfile:str | None, paramiko:Any=None) -> AnyAttempt to make an ssh connection without a password.
method
jupyter_client.threaded.IOLoopThread.close() -> NoneClose the io loop thread.
method
jupyter_client.threaded.IOLoopThread.run() -> NoneRun my loop, ignoring EINTR events in the poller
method
jupyter_client.threaded.IOLoopThread.stop() -> NoneStop the channel's event loop and join its thread.
class
jupyter_client.threaded.ThreadedZMQSocketChannelA ZMQ socket invoking a callback in the ioloop
method
jupyter_client.threaded.ThreadedZMQSocketChannel.close() -> NoneClose the channel.
method
jupyter_client.threaded.ThreadedZMQSocketChannel.flush(timeout:float=1.0) -> NoneImmediately processes all pending messages on this channel.
method
jupyter_client.threaded.ThreadedZMQSocketChannel.is_alive() -> boolWhether the channel is alive.
method
jupyter_client.threaded.ThreadedZMQSocketChannel.send(msg:dict[str, Any]) -> NoneQueue a message to be sent from the IOLoop's thread.
method
jupyter_client.threaded.ThreadedZMQSocketChannel.start() -> NoneStart the channel.
method
jupyter_client.threaded.ThreadedZMQSocketChannel.stop() -> NoneStop the channel.
func
jupyter_client.win_interrupt.create_interrupt_event() -> AnyCreate an interrupt event handle.
func
jupyter_client.win_interrupt.send_interrupt(interrupt_handle:Any) -> NoneSends 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.