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.
| ATTRIBUTE | DESCRIPTION |
|---|---|
consumed_streams |
List of data streams the function is consuming from
TYPE:
|
function_id |
identifier object of a StreamPipes function
TYPE:
|
output_data_streams |
Map off all output data streams added to the function definition
TYPE:
|
Config
¶
Configuration class for Pydantic. Defines alias generator to convert field names from camelCase (API) to snake_case (Python codebase).
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:
|
| RETURNS | DESCRIPTION |
|---|---|
self
|
Instance of the function definition that is extended by the provided
TYPE:
|
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:
|
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:
|
get_output_stream_ids()
¶
Get the stream ids of the output data streams.
| RETURNS | DESCRIPTION |
|---|---|
output_stream_ids
|
List of all stream ids
TYPE:
|
to_dict(use_source_names=True)
¶
Returns the resource in dictionary representation.
| PARAMETER | DESCRIPTION |
|---|---|
use_source_names |
Indicates if the dictionary keys are in python representation or equally named to the StreamPipes backend
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
resource
|
The resource as dictionary representation
TYPE:
|
FunctionId
¶
Bases: BasicModel
Identification object for a StreamPipes function.
Maps to the FunctionId class defined in the StreamPipes model.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
unique identifier of the function instance
TYPE:
|
version |
version of the corresponding function
TYPE:
|
Config
¶
Configuration class for Pydantic. Defines alias generator to convert field names from camelCase (API) to snake_case (Python codebase).