---
title: "comm | pypx"
description: "Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc."
canonical_url: "https://pypx.app/packages/comm"
meta:
  "og:description": "Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc."
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_comm%2Cversion_0.2.3%2Csummary_~SnVweXRlciBQeXRob24gQ29tbSBpbXBsZW1lbnRhdGlvbiwgZm9yIHVzYWdlIGluIGlweWtlcm5lbCwgeGV1cy1weXRob24gZXRjLg%2Clicense_BSD%2BLicense%2Cp_Ii9wYWNrYWdlcy9jb21tIg%2Cs_gK7b3NBVXLsE8Dvv.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "comm 0.2.3"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_comm%2Cversion_0.2.3%2Csummary_~SnVweXRlciBQeXRob24gQ29tbSBpbXBsZW1lbnRhdGlvbiwgZm9yIHVzYWdlIGluIGlweWtlcm5lbCwgeGV1cy1weXRob24gZXRjLg%2Clicense_BSD%2BLicense%2Cp_Ii9wYWNrYWdlcy9jb21tIg%2Cs_gK7b3NBVXLsE8Dvv.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **comm**

v0.2.3

Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc.

7 KB Python 3.8+ py3-none-anyBSD License

[**Diff **](https://pypx.app/packages/comm/diff)

`$ uv add comm`

# 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)
```

## **Details **

<dl>

<dt>Version</dt>
<dd>0.2.3</dd>

<dt>License</dt>
<dd>BSD License</dd>

<dt>Python</dt>
<dd>&gt;=3.8</dd>

<dt>Maintainer</dt>
<dd>Jupyter contributors</dd></dl>

## **Links**

- [Homepage](https://github.com/ipython/comm)
- [View on PyPI](https://pypi.org/project/comm/)

## **Maintainers **

- Jupyter contributors

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/comm#webpage","@type":"WebPage","description":"Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc.","name":"comm","url":"https://pypx.app/packages/comm","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/comm"]}]},{"@id":"https://pypx.app/packages/comm#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc.","license":"BSD License","name":"comm","softwareVersion":"0.2.3"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
