As a quick example, we demonstrate how to set up and configure a StreamPipes client. In addition, we will get the available data lake measures out of StreamPipes.
from streampipes.client import StreamPipesClient from streampipes.client.config import StreamPipesClientConfig from streampipes.client.credential_provider import StreamPipesApiKeyCredentials config = StreamPipesClientConfig( credential_provider = StreamPipesApiKeyCredentials( username = "email@example.com", api_key = "DEMO-KEY", ), host_address = "localhost", https_disabled = True, port = 80 ) client = StreamPipesClient(client_config=config) # get all available datat lake measures measures = client.dataLakeMeasureApi.all() # get amount of retrieved measures len(measures)
# inspect the data lake measures as pandas dataframe measures.to_pandas()
measure_name timestamp_field ... pipeline_is_running num_event_properties 0 test s0::timestamp ... False 2 [1 rows x 6 columns]
Alternatively, you can provide your credentials via environment variables. Simply define your credential provider as follows:
from streampipes.client.credential_provider import StreamPipesApiKeyCredentials StreamPipesApiKeyCredentials()
username is always the username that is used to log in into StreamPipes.
api_key can be generated within the UI as demonstrated below: