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.1
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.1.tar.gz | 4.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| comm-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.4 kB
Release files / comm-0.1.1.tar.gz
| Download URL | comm-0.1.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f395ea64f4f261f35ffc2fbf80a62ec071375dac48cd3ea56092711e74dd063e
|
|
BLAKE2b-256 checksum How to use checksums |
abee5f477209e0baffc20739efb8257f6c0fe86ac96b6bd799a8a796bbfada12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|
Release files / comm-0.1.1-py3-none-any.whl
| Download URL | comm-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
788a4ec961956c1cb2b0ba3c21f2458ff5757bb2f552032b140787af88d670a3
|
|
BLAKE2b-256 checksum How to use checksums |
84a7d515f442c429ad069ce384b08d4aaa061fb9cabab679b93c82b232d17d1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.5
|