Basic example

Source code :

import guidata
_app = guidata.qapplication() # not required if a QApplication has already been created

import guidata.dataset.datatypes as dt
import guidata.dataset.dataitems as di

class Processing(dt.DataSet):
    a = di.FloatItem("Parameter #1", default=2.3)
    b = di.IntItem("Parameter #2", min=0, max=10, default=5)
    type = di.ChoiceItem("Processing algorithm",
                         ("type 1", "type 2", "type 3"))

param = Processing()

Output :


Assigning values to data items or using these values is very easy :

param.a = 5.34
param.type = "type 3"
print "a*b =", param.a*param.b

Other examples

A lot of examples are available in the guidata test module

from guidata import tests

The two lines above execute the guidata test launcher :


All guidata items demo


Embedding guidata objects in GUI layouts


Data item groups and group selection


Activable data sets


Data set groups