DataDictIO

class ikomia.dataprocess.datadictIO.DataDictIO

Class implementing Ikomia workflow input/output object where data is stored as generic Python dict. Please note that such unformatted data are meant to be used as task output essentially. For complete compatibility with other API features, you must ensure that the dict content is fully JSON serializable. Inherit CWorkflowTaskIO.

Variables:

data – data dictionary

Import

from ikomia.dataprocess.datadictIO import DataDictIO

Overridden methods

clear_data()

Clear whole data dict.

is_data_available()

Check whether the dataset structure contains data.

load(path)

Load JSON as data dict I/O.

save(path)

Save data dict as JSON.

to_json([options])

Convert DataDictIO internal data as JSON string.

from_json(json_string)

Set internal data from JSON string.

Details

__init__((object)arg1) None
__init__( (object)self) -> None :

Default constructor

__init__( (object)self, (IODataType)data_type) -> None :

Constructor with parameters

Args:

data_type (IODataType): data type identifier

__init__( (object)self, (IODataType)data_type, (str)name) -> None :

Constructor with parameters

Args:

data_type(IODataType): data type identifier

name (str): custom name associated to input/output to give more insights to end user

__init__( (object)arg1, (CWorkflowTaskIO)arg2) -> None :

Copy constructor

clear_data()

Clear whole data dict.

from_json(json_string: str)

Set internal data from JSON string.

Parameters:

json_string (str) – I/O data as JSON formatted string (from to_json() for example)

is_data_available() bool

Check whether the dataset structure contains data.

Returns:

True or False

Return type:

boolean

load(path: str)

Load JSON as data dict I/O.

Parameters:

path (str) – file path where dataset is saved

save(path: str)

Save data dict as JSON.

Parameters:

path (str) – file path where data is saved

to_json(options: list = None) str

Convert DataDictIO internal data as JSON string.

Parameters:

options (list) – JSON format options [‘json_format’, ‘compact’] or [‘json_format’, ‘indented’]

Returns:

JSON formatted string

Return type:

str