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)
Release files for comm 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| comm-0.2.3.tar.gz | 6.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| comm-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:13.6 kB
Release files / comm-0.2.3.tar.gz
| Download URL | comm-0.2.3.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2dc8048c10962d55d7ad693be1e7045d891b7ce8d999c97963a5e3e99c055971
|
|
BLAKE2b-256 checksum How to use checksums |
4c137d740c5849255756bc17888787313b61fd38a0a8304fc4f073dfc46122aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / comm-0.2.3-py3-none-any.whl
| Download URL | comm-0.2.3-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c615d91d75f7f04f095b30d1c1711babd43bdc6419c1be9886a85f2f4e489417
|
|
BLAKE2b-256 checksum How to use checksums |
6097891a0971e1e4a8c5d2b20bbe0e524dc04548d2307fee33cdeba148fd4fc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|