FunctionCodec

Inheritance diagram of FunctionCodec
class FunctionCodec(func_name)[source]

A generic function codec

Import from taurus.core.util.codecs as:

from taurus.core.util.codecs import FunctionCodec
decode(data, *args, **kwargs)[source]

decodes the given data. This method is abstract an therefore must be implemented in the subclass.

Parameters:

data (sequence[str, obj]) – a sequence of two elements where the first item is the encoding format of the second item object

Returns:

a sequence of two elements where the first item is the encoding format of the second item object

Return type:

sequence[str, obj]

Raises:

NotImplementedError

encode(data, *args, **kwargs)[source]

encodes the given data. This method is abstract an therefore must be implemented in the subclass.

Parameters:

data (sequence[str, obj]) – a sequence of two elements where the first item is the encoding format of the second item object

Returns:

a sequence of two elements where the first item is the encoding format of the second item object

Return type:

sequence[str, obj]

Raises:

NotImplementedError