Skip to main content

Comm

It provides a way to register a Kernel Comm implementation, as per the Jupyter kernel protocol. It also provides a base Comm implementation and a default CommManager that can be used.

Register a comm implementation in the kernel:

Case 1: Using the default CommManager and the BaseComm implementations

We provide default implementations for usage in IPython:

import comm


class MyCustomComm(comm.base_comm.BaseComm):
    def publish_msg(self, msg_type, data=None, metadata=None, buffers=None, **keys):
        # TODO implement the logic for sending comm messages through the iopub channel
        pass


comm.create_comm = MyCustomComm

This is typically what ipykernel and JupyterLite's pyolite kernel will do.

Case 2: Providing your own comm manager creation implementation

import comm

comm.create_comm = custom_create_comm
comm.get_comm_manager = custom_comm_manager_getter

This is typically what xeus-python does (it has its own manager implementation using xeus's C++ messaging logic).

Comm users

Libraries like ipywidgets can then use the comms implementation that has been registered by the kernel:

from comm import create_comm, get_comm_manager

# Create a comm
comm_manager = get_comm_manager()
comm = create_comm()

comm_manager.register_comm(comm)

Metadata

Release files for comm 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comm 0.2.2
File Size Uploaded
comm-0.2.2.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for comm 0.2.2
File Interpreter ABI Platform
comm-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / comm-0.2.2.tar.gz

Download URL comm-0.2.2.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3fd7a84065306e07bea1773df6eb8282de51ba82f77c72f9c85716ab11fe980e
BLAKE2b-256 checksum
How to use checksums
e9a8fb783cb0abe2b5fded9f55e5703015cdf1c9c85b3669087c538dd15a6a86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.11.8

Release files / comm-0.2.2-py3-none-any.whl

Download URL comm-0.2.2-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6fb86cb70ff661ee8c9c14e7d36d6de3b4066f1441be4063df9c5009f0a64d3
BLAKE2b-256 checksum
How to use checksums
e67549e5bfe642f71f272236b5b2d2691cf915a7283cc0ceda56357b61daa538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.11.8

Release history Release notifications | RSS feed

0.2.3

2 release files

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page