{"id":15014291,"url":"https://github.com/ipython/comm","last_synced_at":"2025-04-09T05:09:18.599Z","repository":{"id":50903284,"uuid":"520122918","full_name":"ipython/comm","owner":"ipython","description":"Python Comm implementation for the Jupyter kernel protocol","archived":false,"fork":false,"pushed_at":"2025-03-18T17:11:20.000Z","size":45,"stargazers_count":10,"open_issues_count":2,"forks_count":17,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-31T17:07:36.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipython.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-01T13:31:48.000Z","updated_at":"2025-03-18T17:11:25.000Z","dependencies_parsed_at":"2022-08-03T02:00:23.839Z","dependency_job_id":"520e13a5-7feb-4d3a-bd61-44bbdd031adc","html_url":"https://github.com/ipython/comm","commit_stats":{"total_commits":18,"total_committers":5,"mean_commits":3.6,"dds":0.5,"last_synced_commit":"7e098f5d01629d330ec3a53b72ab39cbd7e8a12b"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fcomm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fcomm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fcomm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipython%2Fcomm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipython","download_url":"https://codeload.github.com/ipython/comm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T19:45:25.621Z","updated_at":"2025-04-09T05:09:18.578Z","avatar_url":"https://github.com/ipython.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Comm\n\nIt provides a way to register a Kernel Comm implementation, as per the Jupyter kernel protocol.\nIt also provides a base Comm implementation and a default CommManager that can be used.\n\n## Register a comm implementation in the kernel:\n\n### Case 1: Using the default CommManager and the BaseComm implementations\n\nWe provide default implementations for usage in IPython:\n\n```python\nimport comm\n\n\nclass MyCustomComm(comm.base_comm.BaseComm):\n    def publish_msg(self, msg_type, data=None, metadata=None, buffers=None, **keys):\n        # TODO implement the logic for sending comm messages through the iopub channel\n        pass\n\n\ncomm.create_comm = MyCustomComm\n```\n\nThis is typically what ipykernel and JupyterLite's pyolite kernel will do.\n\n### Case 2: Providing your own comm manager creation implementation\n\n```python\nimport comm\n\ncomm.create_comm = custom_create_comm\ncomm.get_comm_manager = custom_comm_manager_getter\n```\n\nThis is typically what xeus-python does (it has its own manager implementation using xeus's C++ messaging logic).\n\n## Comm users\n\nLibraries like ipywidgets can then use the comms implementation that has been registered by the kernel:\n\n```python\nfrom comm import create_comm, get_comm_manager\n\n# Create a comm\ncomm_manager = get_comm_manager()\ncomm = create_comm()\n\ncomm_manager.register_comm(comm)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipython%2Fcomm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipython%2Fcomm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipython%2Fcomm/lists"}