Skip to content

Function definition

FunctionDefinition

Bases: Resource

Configuration for a StreamPipes Function.

This class maps to the FunctionDefinition class in the StreamPipes model. It contains all metadata that are required to register a function at the StreamPipes backend.

PARAMETER DESCRIPTION
consumed_streams

List of data streams the function is consuming from

function_id

identifier object of a StreamPipes function

ATTRIBUTE DESCRIPTION
output_data_streams

Map off all output data streams added to the function definition

TYPE: Dict[str, DataStream]

add_output_data_stream(data_stream)

Adds an output data stream to the function which makes it possible to write data back to StreamPipes.

PARAMETER DESCRIPTION
data_stream

The schema of the output data stream.

TYPE: DataStream

RETURNS DESCRIPTION
self

Instance of the function definition that is extended by the provided DataStream

TYPE: FunctionDefinition

convert_to_pandas_representation()

Returns the dictionary representation of a function definition to be used when creating a pandas Dataframe.

RETURNS DESCRIPTION
pandas_repr

Pandas representation of the resource as a dictionary, which is then used by the respource container to create a data frame from a collection of resources.

TYPE: Dict[str, Any]

get_output_data_streams()

Get the output data streams of the function.

RETURNS DESCRIPTION
output_streams

Dictionary with every known stream id and the related output stream.

TYPE: Dict[str, DataStream]

get_output_stream_ids()

Get the stream ids of the output data streams.

RETURNS DESCRIPTION
output_stream_ids

List of all stream ids

TYPE: List[str]

FunctionId

Bases: BasicModel

Identification object for a StreamPipes function.

Maps to the FunctionId class defined in the StreamPipes model.

PARAMETER DESCRIPTION
id

unique identifier of the function instance

version

version of the corresponding function