Registry / data / orange-widget-base

orange-widget-base

JSON →
library4.27.0pypypiunverified

Base classes for creating Orange Canvas widgets. Provides OWBaseWidget and its derived classes for building interactive data mining components. Current version 4.27.0, requires Python >=3.10. Released as part of the Orange data mining suite.

pip install orange-widget-base
INSTALL
IMPORT
SIG · ORANGE-WIDGET-BASE
O
orange-widget-base
datapythonv4.27.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OWBaseWidget
✓ from orangewidget.widget import OWBaseWidget
✗ from orangewidget.widget import OWBaseWidget

Minimal OWBaseWidget subclass with inputs, outputs, settings, and control area.

from orangewidget.widget import OWBaseWidget, Input, Output from orangewidget import gui from orangewidget.settings import Setting class MyWidget(OWBaseWidget): name = "My Widget" description = "A custom widget" icon = "icons/my.svg" priority = 10 class Inputs: data = Input("Data", object, "set_data") class Outputs: result = Output("Result", object) settings = {"threshold": Setting(0.5)} want_main_area = False def __init__(self): super().__init__() self.threshold = 0.5 gui.doubleSpin(self.controlArea, self, "threshold", 0, 1, 0.1, label="Threshold:") def set_data(self, data): pass if __name__ == "__main__": from orangewidget.utils.widgetpreview import WidgetPreview WidgetPreview(MyWidget).run()
Debug
Known issues
breakingIn version 4.x, the signal handling API changed from connect/disconnect style to decorator-based Input/Output classes. Old code using `self.inputs = [...]` or `self.outputs = [...]` will break.
fix
Define Inputs and Outputs as inner classes with Input/Output instances.
affects: >=4.0.0
breakingThe `gui` module was removed from `Orange.widgets` and moved to the separate `orangewidget` package. Importing from `Orange.widgets.gui` will raise ImportError.
fix
Use `from orangewidget import gui` instead.
affects: >=4.0.0
breakingThe `Orange.widgets.settings` module moved to `orangewidget.settings`. The `Setting` class import path changed.
fix
Import from `orangewidget.settings import Setting`.
affects: >=4.0.0
breakingThe `orange-canvas-core` package now enforces the new widget API. Old-style widgets may not load or cause errors.
fix
Update widgets to use OWBaseWidget and Input/Output decorators.
affects: >=4.0.0
deprecatedThe use of `getattr(self, 'handler_{}'.format(signal_name))` signal handlers is deprecated in favor of explicit methods linked via `Input` decorator.
fix
Define handler methods with descriptive names and link them via `Input("Name", type, "method_name")`.
affects: >=4.0.0
gotchaThe `name` attribute of OWBaseWidget must be a non-empty string, otherwise the widget may not appear in the canvas.
fix
Always set `name` to a unique, descriptive string.
affects: all
gotchaSignals types must be actual Python objects (classes), not strings. Using strings for type will raise a TypeError at registration.
fix
Pass the class object, e.g., `Input("Data", Orange.data.Table, "set_data")`.
affects: >=4.0.0
Upgrade
Version history
4.27.0latest on PyPI · released Dec 19, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Anthropic
1
Resources
orange-widget-base — pip install orange-widget-base · libregistry