euporie.core.comm.ipywidgets

Define representations for ipywidget comms.

Functions

abstractmethod(funcobj)

A decorator indicating abstract methods.

copy(x)

Shallow copy operation on arbitrary Python objects.

open_comm_ipywidgets(comm_container, ...)

Create a new Comm for an ipywidgets widget.

standard_b64encode(s)

Encode bytes-like object s using the standard Base64 alphabet.

Classes

ABCMeta(name, bases, namespace, /, **kwargs)

Metaclass for defining Abstract Base Classes (ABCs).

AccordionModel(comm_container, comm_id, ...)

An accoridon layout ipywidget.

AccordionSplit(children, titles[, active, ...])

A container which switches between children using expandable sections.

BeforeInput(text[, style])

Insert text before the input.

BoundedFloatTextModel(comm_container, ...)

An float textbox ipwidget with upper and lower bounds.

BoundedIntTextModel(comm_container, comm_id, ...)

An integer textbox ipwidget with upper and lower bounds.

Box(body[, padding, padding_left, ...])

Add padding around a container.

BoxModel(comm_container, comm_id, data, buffers)

A box layout ipywidget (basically the same a HBox).

Button(text, on_click, None] | None = None, ...)

A clickable button widget.

ButtonModel(comm_container, comm_id, data, ...)

A Button ipywidget.

CellOutputArea(json, parent[, style])

An area below a cell where one or more cell outputs can be shown.

Checkbox([text, on_click, prefix, style, ...])

A toggleable checkbox widget.

CheckboxModel(comm_container, comm_id, data, ...)

A checkbox ipywidget.

ColorPickerModel(comm_container, comm_id, ...)

A color picker ipywidget.

ComboboxModel(comm_container, comm_id, data, ...)

A combobox input widget.

Comm(comm_container, comm_id, data, buffers)

A base-class for all comm objects, which support syncing traits with the kernel.

CommView(container[, setters])

Hold a container and methods to update its attributes.

Condition(func)

Turn any callable into a Filter.

DatePickerModel(comm_container, comm_id, ...)

A date-picker ipywidget.

Decimal([value, context])

Construct a new Decimal object.

DiBool([top, right, bottom, left])

A tuple of four bools with directions.

Display(data, format_[, path, fg_color, ...])

Rich output displays.

Dropdown(options[, labels, index, indices, ...])

A dropdown widget, allowing selection of an item from a menu of options.

DropdownModel(comm_container, comm_id, data, ...)

An ipywidget allowing an item to be selected using a drop-down menu.

FloatLogOptionsMixin()

A mixin for ipywidgets which accept a value from range of exponents.

FloatLogSliderModel(comm_container, comm_id, ...)

A slider ipywidget that accepts a single value on a log scale.

FloatOptionsMixin()

A mixin for ipywidgets which accept a range of float values.

FloatProgressModel(comm_container, comm_id, ...)

A progress bar ipywidget that accepts float values.

FloatRangeSliderModel(comm_container, ...)

A slider ipywidget that accepts a range of float values.

FloatSliderModel(comm_container, comm_id, ...)

A slider ipywidget that accepts a single float value.

FloatTextModel(comm_container, comm_id, ...)

A float textbox ipwidget.

FocusedStyle(body[, style_focus, style_hover])

Apply a style to child containers when focused or hovered.

HBoxModel(comm_container, comm_id, data, buffers)

A horizontal layout ipywidget.

HSplit(children[, window_too_small, align, ...])

Several layouts, one stacked above/under the other. ::.

HTMLMathModel(comm_container, comm_id, data, ...)

Alia for HTMLModel, which can render maths.

HTMLModel(comm_container, comm_id, data, buffers)

A label ipywidget which displays HTML.

ImageModel(comm_container, comm_id, data, ...)

A ipywidget which displays an image.

IntOptionsMixin()

A mixin for ipywidgets which accept a range of integer values.

IntProgressModel(comm_container, comm_id, ...)

A progress bar ipywidget that accepts integer values.

IntRangeSliderModel(comm_container, comm_id, ...)

A slider ipywidget that accepts a range of integer values.

IntSliderModel(comm_container, comm_id, ...)

A slider ipywidget that accepts a single integer value.

IntTextModel(comm_container, comm_id, data, ...)

An integer textbox ipwidget.

IpyWidgetComm(comm_container, comm_id, data, ...)

A Comm object which represents ipython widgets.

Label(value[, style, html])

A label widget which displays rich text.

LabelModel(comm_container, comm_id, data, ...)

A label ipwidget.

LabelledWidget(body, label[, style, ...])

A widget which applies a label to another widget.

LayoutIpyWidgetComm(comm_container, comm_id, ...)

Base class for layout widgets with children.

MsgCallbacks

Typed dictionary for named message callbacks.

NumberTextBoxIpyWidgetComm(comm_container, ...)

Base class for text-box ipywidgets with numerical values.

OutputModel(comm_container, comm_id, data, ...)

An Output ipywidget.

Progress([start, stop, step, value, ...])

A progress-bar widget.

ProgressIpyWidgetComm(comm_container, ...)

The base class for progress bar ipywidgets.

RadioButtonsModel(comm_container, comm_id, ...)

An ipywidget allowing an item to be selected using radio buttons.

RangeSliderIpyWidgetComm(comm_container, ...)

Base class for range slider ipywidgets.

ReferencedSplit(split, children, *args, **kwargs)

A split container which maintains a reference to it's children.

Select(options, labels, index, indices, ...)

A select widget, which allows one or more items to be selected from a list.

SelectModel(comm_container, comm_id, data, ...)

An ipywidget allowing a value to be selected from a list of options.

SelectMultipleModel(comm_container, comm_id, ...)

An ipywidget allowing one or more value to be selected from a list of options.

SelectableIpyWidgetComm(comm_container, ...)

Base class for selectable ipywidgets.

SelectionRangeSliderModel(comm_container, ...)

A slider ipywidget where one or more of a list of options can be selected.

SelectionSliderModel(comm_container, ...)

A slider ipywidget where one of a list of options can be selected.

Slider(options, labels, index, indices, ...)

A slider widget with an optional editable readout.

SliderIpyWidgetComm(comm_container, comm_id, ...)

Base class for slider ipywidgets.

Swatch(color, str] =, width, height, style, ...)

An widget which displays a given color.

TabModel(comm_container, comm_id, data, buffers)

A tabbed layout ipywidget.

TabbedSplit(children, titles, active, style, ...)

A container which switches between children using tabs.

Text([text, style, height, min_height, ...])

A text input widget.

TextBoxIpyWidgetComm(comm_container, ...)

A mixin for ipywidgets which use text-box entry.

TextModel(comm_container, comm_id, data, buffers)

A text input widget.

TextareaModel(comm_container, comm_id, data, ...)

A text input widget.

ToggleButton(text, on_click, ...)

A toggleable button widget.

ToggleButtonModel(comm_container, comm_id, ...)

A toggleable button ipywidget.

ToggleButtons(options, labels, index, ...)

A widget where an option is selected using mutually exclusive toggle-buttons.

ToggleButtonsModel(comm_container, comm_id, ...)

An ipywidget where a single value can be selected using togglable buttons.

ToggleableIpyWidgetComm(comm_container, ...)

Base class for toggleable ipywidgets.

UnimplementedModel(comm_container, comm_id, ...)

An ipywidget used to represent unimplemented widgets.

VBoxModel(comm_container, comm_id, data, buffers)

A vertical layout ipywidget.

VSplit(children[, window_too_small, align, ...])

Several layouts, one stacked left/right of the other. ::.

ValidModel(comm_container, comm_id, data, ...)

A validity indicator ipywidget.

date

date(year, month, day) --> date object

datetime(year, month, day[, hour[, minute[, ...)

The year, month and day arguments are required.

partial

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

class euporie.core.comm.ipywidgets.AccordionModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.LayoutIpyWidgetComm

An accoridon layout ipywidget.

box_style() str

Convert the ipywidget box_style to a prompt_toolkit style string.

create_view(parent: OutputParent) CommView

Create a new view of the accordion ipywidget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

render_children(models: list[str], parent: OutputParent) list[AnyContainer]

Create views for the child Comms in the layout.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: StackedSplit) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.BoundedFloatTextModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.FloatOptionsMixin, euporie.core.comm.ipywidgets.NumberTextBoxIpyWidgetComm

An float textbox ipwidget with upper and lower bounds.

create_view(parent: OutputParent) CommView

Create a new view of the numerical text-box ipywidget.

data: dict[str, Any]
decr(button: euporie.core.widgets.forms.Button) None

Decrement the widget’s value by one step.

default_rows = 1
incr(button: euporie.core.widgets.forms.Button) None

Increment the widget’s value by one step.

multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of floats.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

class euporie.core.comm.ipywidgets.BoundedIntTextModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IntOptionsMixin, euporie.core.comm.ipywidgets.NumberTextBoxIpyWidgetComm

An integer textbox ipwidget with upper and lower bounds.

create_view(parent: OutputParent) CommView

Create a new view of the numerical text-box ipywidget.

data: dict[str, Any]
decr(button: euporie.core.widgets.forms.Button) None

Decrement the widget’s value by one step.

default_rows = 1
incr(button: euporie.core.widgets.forms.Button) None

Increment the widget’s value by one step.

multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) int | None

Enure the selected value is within the permitted range and is a integer.

property options: list[int]

Generate a list of available options in a range of integers.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

class euporie.core.comm.ipywidgets.BoxModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.LayoutIpyWidgetComm

A box layout ipywidget (basically the same a HBox).

Split

alias of prompt_toolkit.layout.containers.VSplit

box_style() str

Convert the ipywidget box_style to a prompt_toolkit style string.

create_view(parent: OutputParent) CommView

Create a new view of the layout ipywidget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

padding = 1
process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

render_children(models: list[str], parent: OutputParent) list[AnyContainer]

Create views for the child Comms in the layout.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.ButtonModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

A Button ipywidget.

button_style() str

Convert the ipywidget button_style to a prompt_toolkit style string.

click(button: euporie.core.widgets.forms.Button) None

Send a comm_msg describing a click event.

create_view(parent: OutputParent) CommView

Create a new view of the button ipywidget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
text() str

Generate the button text, optionally including an icon if specified.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.CheckboxModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.ToggleableIpyWidgetComm

A checkbox ipywidget.

create_view(parent: OutputParent) CommView

Create a new view of the checkbox ipywidget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Cat the container’s selected value to a bool if possible.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

value_changed(button: ToggleableWidget) None

Send a comm_message updating the value when it changes.

class euporie.core.comm.ipywidgets.ColorPickerModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.TextBoxIpyWidgetComm

A color picker ipywidget.

create_view(parent: OutputParent) CommView

Create a new view of the color-picker widget.

default_rows = 1
format_color() str

Format a color as a hex code for display.

multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: str) str | None

Return the color string if it is recognised as an allowed color.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

class euporie.core.comm.ipywidgets.ComboboxModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.TextBoxIpyWidgetComm

A combobox input widget.

create_view(parent: OutputParent) CommView

Create a new view of the text-box ipywidget.

default_rows = 1
multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: str) str | None

Enure that the entered text matches a permitted option, if required.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

class euporie.core.comm.ipywidgets.DatePickerModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.TextBoxIpyWidgetComm

A date-picker ipywidget.

create_view(parent: OutputParent) CommView

Create a new view of the date-picker widget.

default_rows = 1
multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: str) dict[str, int] | None

Attempt to convert entered text to the internal date representation.

parse_date(value: dict[str, int]) datetime.date

Convert the internal date representation to a python date.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the text to display in the widget’s text area.

class euporie.core.comm.ipywidgets.DropdownModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.SelectableIpyWidgetComm

An ipywidget allowing an item to be selected using a drop-down menu.

create_view(parent: OutputParent) CommView

Create a new view of the drop-down widget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: SelectableWidget) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.FloatLogOptionsMixin

Bases: euporie.core.comm.ipywidgets.FloatOptionsMixin

A mixin for ipywidgets which accept a value from range of exponents.

data: dict[str, Any]
normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of log values.

class euporie.core.comm.ipywidgets.FloatLogSliderModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.FloatLogOptionsMixin, euporie.core.comm.ipywidgets.SliderIpyWidgetComm

A slider ipywidget that accepts a single value on a log scale.

create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[Any]

Return the selected index as a list.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of log values.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: Slider, value: Any) None

Set the selected index when the ipywidget’s selected value changes.

target_name = 'jupyter.widget'
update_value(container: SelectableWidget) None

Send a comm_message updating the value when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.FloatOptionsMixin

Bases: object

A mixin for ipywidgets which accept a range of float values.

data: dict[str, Any]
normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of floats.

class euporie.core.comm.ipywidgets.FloatProgressModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.FloatOptionsMixin, euporie.core.comm.ipywidgets.ProgressIpyWidgetComm

A progress bar ipywidget that accepts float values.

bar_style() str

Convert the ipywidget bar_style to a prompt_toolkit style string.

create_view(parent: OutputParent) CommView

Create a new view of the progress bar.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of floats.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.FloatRangeSliderModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.FloatOptionsMixin, euporie.core.comm.ipywidgets.RangeSliderIpyWidgetComm

A slider ipywidget that accepts a range of float values.

create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[int]

Return the first and last selected indices.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of floats.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: Slider, values: Any) None

Any float value is permitted - we might need to add an option.

target_name = 'jupyter.widget'
update_value(slider: SelectableWidget) None

Send a comm_message updating the values when they change.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.FloatSliderModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.FloatOptionsMixin, euporie.core.comm.ipywidgets.SliderIpyWidgetComm

A slider ipywidget that accepts a single float value.

create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[Any]

Return the selected index as a list.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of floats.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: Slider, value: Any) None

Set the selected index when the ipywidget’s selected value changes.

target_name = 'jupyter.widget'
update_value(container: SelectableWidget) None

Send a comm_message updating the value when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.FloatTextModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.FloatOptionsMixin, euporie.core.comm.ipywidgets.NumberTextBoxIpyWidgetComm

A float textbox ipwidget.

create_view(parent: OutputParent) CommView

Create a new view of the numerical text-box ipywidget.

data: dict[str, Any]
decr(button: euporie.core.widgets.forms.Button) None

Decrement the widget’s value by one step.

default_rows = 1
incr(button: euporie.core.widgets.forms.Button) None

Increment the widget’s value by one step.

multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Enure the selected value is within the permitted range and is a float.

property options: list[float]

Generate a list of available options in a range of floats.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

class euporie.core.comm.ipywidgets.HBoxModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.BoxModel

A horizontal layout ipywidget.

Split

alias of prompt_toolkit.layout.containers.VSplit

box_style() str

Convert the ipywidget box_style to a prompt_toolkit style string.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the layout ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

padding = 1
process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

render_children(models: list[str], parent: OutputParent) list[AnyContainer]

Create views for the child Comms in the layout.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.HTMLMathModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.HTMLModel

Alia for HTMLModel, which can render maths.

create_view(parent: OutputParent) CommView

Create a new view of the HTML widget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.HTMLModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

A label ipywidget which displays HTML.

create_view(parent: OutputParent) CommView

Create a new view of the HTML widget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.ImageModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

A ipywidget which displays an image.

create_view(parent: OutputParent) CommView

Create a new view of the image widget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.IntOptionsMixin

Bases: object

A mixin for ipywidgets which accept a range of integer values.

data: dict[str, Any]
normalize(x: Any) int | None

Enure the selected value is within the permitted range and is a integer.

property options: list[int]

Generate a list of available options in a range of integers.

class euporie.core.comm.ipywidgets.IntProgressModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IntOptionsMixin, euporie.core.comm.ipywidgets.ProgressIpyWidgetComm

A progress bar ipywidget that accepts integer values.

bar_style() str

Convert the ipywidget bar_style to a prompt_toolkit style string.

create_view(parent: OutputParent) CommView

Create a new view of the progress bar.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) int | None

Enure the selected value is within the permitted range and is a integer.

property options: list[int]

Generate a list of available options in a range of integers.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.IntRangeSliderModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IntOptionsMixin, euporie.core.comm.ipywidgets.RangeSliderIpyWidgetComm

A slider ipywidget that accepts a range of integer values.

create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[int]

Return the first and last selected indices.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) int | None

Enure the selected value is within the permitted range and is a integer.

property options: list[int]

Generate a list of available options in a range of integers.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: Slider, values: Any) None

Any float value is permitted - we might need to add an option.

target_name = 'jupyter.widget'
update_value(slider: SelectableWidget) None

Send a comm_message updating the values when they change.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.IntSliderModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IntOptionsMixin, euporie.core.comm.ipywidgets.SliderIpyWidgetComm

A slider ipywidget that accepts a single integer value.

create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[Any]

Return the selected index as a list.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) int | None

Enure the selected value is within the permitted range and is a integer.

property options: list[int]

Generate a list of available options in a range of integers.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: Slider, value: Any) None

Set the selected index when the ipywidget’s selected value changes.

target_name = 'jupyter.widget'
update_value(container: SelectableWidget) None

Send a comm_message updating the value when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.IntTextModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IntOptionsMixin, euporie.core.comm.ipywidgets.NumberTextBoxIpyWidgetComm

An integer textbox ipwidget.

create_view(parent: OutputParent) CommView

Create a new view of the numerical text-box ipywidget.

data: dict[str, Any]
decr(button: euporie.core.widgets.forms.Button) None

Decrement the widget’s value by one step.

default_rows = 1
incr(button: euporie.core.widgets.forms.Button) None

Increment the widget’s value by one step.

multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) int | None

Enure the selected value is within the permitted range and is a integer.

property options: list[int]

Generate a list of available options in a range of integers.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

class euporie.core.comm.ipywidgets.IpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.base.Comm

A Comm object which represents ipython widgets.

abstract create_view(parent: OutputParent) CommView

Abstract method for creating a view of the ipywidget.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.ipywidgets.LabelModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

A label ipwidget.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the Label widget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.LayoutIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

Base class for layout widgets with children.

box_style() str

Convert the ipywidget box_style to a prompt_toolkit style string.

buffers: Sequence[bytes]
abstract create_view(parent: OutputParent) CommView

Abstract method for creating a view of the ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

render_children(models: list[str], parent: OutputParent) list[AnyContainer]

Create views for the child Comms in the layout.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.NumberTextBoxIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.TextBoxIpyWidgetComm

Base class for text-box ipywidgets with numerical values.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the numerical text-box ipywidget.

data: dict[str, Any]
decr(button: euporie.core.widgets.forms.Button) None

Decrement the widget’s value by one step.

default_rows = 1
incr(button: euporie.core.widgets.forms.Button) None

Increment the widget’s value by one step.

multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any | None

Enure the selected value is permitted and the correct type.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.OutputModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

An Output ipywidget.

add_output(json: dict[str, Any]) None

Add a new output to this widget.

buffers: Sequence[bytes]
clear_output(wait: bool = False) None

Remove all outputs from this widget.

create_view(parent: OutputParent) CommView

Create a new view of this output ipywidget.

data: dict[str, Any]
model_name = 'OutputModel'
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Modify the callbacks of a given message to add outputs to this ipywidget.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.ProgressIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

The base class for progress bar ipywidgets.

bar_style() str

Convert the ipywidget bar_style to a prompt_toolkit style string.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the progress bar.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.RadioButtonsModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.SelectableIpyWidgetComm

An ipywidget allowing an item to be selected using radio buttons.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the radio-buttons widget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: SelectableWidget) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.RangeSliderIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.SliderIpyWidgetComm

Base class for range slider ipywidgets.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[int]

Return the first and last selected indices.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any

Convert the internal widget’s value to one compatible with the ipywidget.

abstract property options: list

Abstract method to return a list of available options.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: Slider, values: Any) None

Any float value is permitted - we might need to add an option.

target_name = 'jupyter.widget'
update_value(slider: SelectableWidget) None

Send a comm_message updating the values when they change.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.SelectModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.SelectableIpyWidgetComm

An ipywidget allowing a value to be selected from a list of options.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the select widget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: SelectableWidget) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.SelectMultipleModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

An ipywidget allowing one or more value to be selected from a list of options.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the multiple select widget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: SelectableWidget) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.SelectableIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

Base class for selectable ipywidgets.

buffers: Sequence[bytes]
abstract create_view(parent: OutputParent) CommView

Abstract method for creating a view of the ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: SelectableWidget) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.SelectionRangeSliderModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.SliderIpyWidgetComm

A slider ipywidget where one or more of a list of options can be selected.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[int]

Return a list of the selected indices.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any

Convert the internal widget’s value to one compatible with the ipywidget.

property options: list[str]

Return a list of the available options.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: euporie.core.widgets.forms.Slider, indices: tuple[int, int]) None

Set the selected indices on the selection slider when the value changes.

target_name = 'jupyter.widget'
update_value(slider: SelectableWidget) None

Send a comm_message updating the selected indices when they change.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.SelectionSliderModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.SliderIpyWidgetComm

A slider ipywidget where one of a list of options can be selected.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[int]

Return the selected index as a list.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any

Convert the internal widget’s value to one compatible with the ipywidget.

property options: list[str]

Return a list of the available options.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: euporie.core.widgets.forms.Slider, index: int) None

Set the selected index on the selection slider when the value changes.

target_name = 'jupyter.widget'
update_value(slider: SelectableWidget) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.SliderIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

Base class for slider ipywidgets.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the slider ipywidget.

data: dict[str, Any]
property indices: list[Any]

Return the selected index as a list.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any

Convert the internal widget’s value to one compatible with the ipywidget.

abstract property options: list

Abstract method to return a list of available options.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

set_value(slider: Slider, value: Any) None

Set the selected index when the ipywidget’s selected value changes.

target_name = 'jupyter.widget'
update_value(container: SelectableWidget) None

Send a comm_message updating the value when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.TabModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.LayoutIpyWidgetComm

A tabbed layout ipywidget.

box_style() str

Convert the ipywidget box_style to a prompt_toolkit style string.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the tabbed ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

render_children(models: list[str], parent: OutputParent) list[AnyContainer]

Create views for the child Comms in the layout.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: StackedSplit) None

Send a comm_message updating the selected index when it changes.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.TextBoxIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

A mixin for ipywidgets which use text-box entry.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the text-box ipywidget.

data: dict[str, Any]
default_rows = 1
multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any | None

Enure the selected value is permitted and the correct type.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.TextModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.TextBoxIpyWidgetComm

A text input widget.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the text-box ipywidget.

data: dict[str, Any]
default_rows = 1
multiline = False
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any | None

Enure the selected value is permitted and the correct type.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.TextareaModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.TextBoxIpyWidgetComm

A text input widget.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the text-box ipywidget.

data: dict[str, Any]
default_rows = 3
multiline = True
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) Any | None

Enure the selected value is permitted and the correct type.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_value(buffer: Buffer) None

Set the selected index when the ipywidget’s entered value changes.

update_views(changes: dict) None

Update all the active views of this Comm.

validation(x: Any) bool

Enure the entered text can be normalized.

value() str

Return the ipywidget’s value.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.ToggleButtonModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.ToggleableIpyWidgetComm

A toggleable button ipywidget.

buffers: Sequence[bytes]
button_style() str

Convert the ipywidget button_style to a prompt_toolkit style string.

create_view(parent: OutputParent) CommView

Create a new view of the toggle button ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Cat the container’s selected value to a bool if possible.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
text() str

Generate the button text, optionally including an icon if specified.

update_views(changes: dict) None

Update all the active views of this Comm.

value_changed(button: ToggleableWidget) None

Send a comm_message updating the value when it changes.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.ToggleButtonsModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

An ipywidget where a single value can be selected using togglable buttons.

buffers: Sequence[bytes]
button_style() str

Convert the ipywidget button_style to a prompt_toolkit style string.

create_view(parent: OutputParent) CommView

Create a new view of the toggle button widget.

data: dict[str, Any]
get_label(index: int) AnyFormattedText

Return the label for each toggle button (optionally including the icon).

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_options(buttons: euporie.core.widgets.forms.ToggleButtons) None

Set the list of selectable options in the toggle buttons.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_index(container: SelectableWidget) None

Set the selected index be sending a comm update message.

update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.ToggleableIpyWidgetComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

Base class for toggleable ipywidgets.

buffers: Sequence[bytes]
abstract create_view(parent: OutputParent) CommView

Abstract method for creating a view of the ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Cat the container’s selected value to a bool if possible.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

value_changed(button: ToggleableWidget) None

Send a comm_message updating the value when it changes.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.UnimplementedModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.IpyWidgetComm

An ipywidget used to represent unimplemented widgets.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.VBoxModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.BoxModel

A vertical layout ipywidget.

Split

alias of prompt_toolkit.layout.containers.HSplit

box_style() str

Convert the ipywidget box_style to a prompt_toolkit style string.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the layout ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

padding = 0
process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

render_children(models: list[str], parent: OutputParent) list[AnyContainer]

Create views for the child Comms in the layout.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

views: WeakKeyDictionary[CommView, OutputParent]
class euporie.core.comm.ipywidgets.ValidModel(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.ipywidgets.ToggleableIpyWidgetComm

A validity indicator ipywidget.

buffers: Sequence[bytes]
create_view(parent: OutputParent) CommView

Create a new view of the validity ipywidget.

data: dict[str, Any]
new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

normalize(x: Any) float | None

Cat the container’s selected value to a bool if possible.

process_data(data: dict, buffers: Sequence[bytes]) None

Handle incoming Comm update messages, updating the state and views.

set_state(key: str, value: JSONType) None

Send a comm_msg to the kernel with local state changes.

target_name = 'jupyter.widget'
update_views(changes: dict) None

Update all the active views of this Comm.

value_changed(button: ToggleableWidget) None

Send a comm_message updating the value when it changes.

views: WeakKeyDictionary[CommView, OutputParent]
euporie.core.comm.ipywidgets.open_comm_ipywidgets(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes]) IpyWidgetComm

Create a new Comm for an ipywidgets widget.

The relevant widget model is selected based on the model name given in the comm_open message data.

Parameters
  • comm_container – The notebook this Comm belongs to

  • comm_id – The ID of the Comm

  • data – The data field from the comm_open message

  • buffers – The buffers field from the comm_open message

Returns

The initialized widget Comm object.