ipykernel.comm package#

Submodules#

Base class for a Comm

class ipykernel.comm.comm.Comm(**kwargs: Any)#

Bases: BaseComm, LoggingConfigurable

Class for communicating between a Frontend and a Kernel

comm_id#

A trait for unicode strings.

kernel: Optional['Kernel']#

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

primary#

Am I the primary or secondary Comm?

target_module#

requirejs module from which to load comm target.

target_name#

A trait for unicode strings.

topic#

A trait for byte strings.

Base class to manage comms

class ipykernel.comm.manager.CommManager(**kwargs: Any)#

Bases: CommManager, LoggingConfigurable

A comm manager.

comm_open(stream, ident, msg)#

Handler for comm_open messages

comms: dict[str, BaseComm]#

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

kernel#

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

targets: dict[str, CommTargetCallback]#

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

Module contents#

class ipykernel.comm.Comm(**kwargs: Any)#

Bases: BaseComm, LoggingConfigurable

Class for communicating between a Frontend and a Kernel

comm_id#

A trait for unicode strings.

kernel: Optional['Kernel']#

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

primary#

Am I the primary or secondary Comm?

target_module#

requirejs module from which to load comm target.

target_name#

A trait for unicode strings.

topic#

A trait for byte strings.

class ipykernel.comm.CommManager(**kwargs: Any)#

Bases: CommManager, LoggingConfigurable

A comm manager.

comm_open(stream, ident, msg)#

Handler for comm_open messages

comms: dict[str, BaseComm]#

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.

kernel#

A trait whose value must be an instance of a specified class.

The value can also be an instance of a subclass of the specified class.

Subclasses can declare default classes by overriding the klass attribute

targets: dict[str, CommTargetCallback]#

An instance of a Python dict.

One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.

Changed in version 5.0: Added key_trait for validating dict keys.

Changed in version 5.0: Deprecated ambiguous trait, traits args in favor of value_trait, per_key_traits.