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.1.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.1.3.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| comm-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / comm-0.1.3.tar.gz
| Download URL | comm-0.1.3.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a61efa9daffcfbe66fd643ba966f846a624e4e6d6767eda9cf6e993aadaab93e
|
|
BLAKE2b-256 checksum How to use checksums |
d61a9937a10f8fd6d9f0f72fa0ab520cec7e50c534b215f8fd2d28e0f0a7f9a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / comm-0.1.3-py3-none-any.whl
| Download URL | comm-0.1.3-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16613c6211e20223f215fc6d3b266a247b6e2641bf4e0a3ad34cb1aff2aa3f37
|
|
BLAKE2b-256 checksum How to use checksums |
74f3b88d7e1dadf741550c56b70d7ce62673354fddb68e143d193ceb80224208
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|