Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc.
Project Links
Meta
Author: Jupyter contributors
Requires Python: >=3.6
Classifiers
Framework
- Jupyter
License
- OSI Approved :: BSD License
Programming Language
- Python
- Python :: 3
- Python :: 3.6
- Python :: 3.7
- Python :: 3.8
- Python :: 3.9
- Python :: 3.10
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)
Jul 25, 2025
0.2.3
Mar 12, 2024
0.2.2
Jan 02, 2024
0.2.1
Nov 06, 2023
0.2.0
Aug 02, 2023
0.1.4
Mar 22, 2023
0.1.3
Dec 08, 2022
0.1.2
Nov 24, 2022
0.1.1
Nov 17, 2022
0.1.0
Nov 02, 2020
0.0.1