This is an automated email from the ASF dual-hosted git repository. bossenti pushed a commit to branch chore/improve-python-docs in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 42e7c2d2c4a5d26dea622af88b40bc485268b73f Author: bossenti <[email protected]> AuthorDate: Tue Feb 28 22:24:12 2023 +0100 chore: fix example code & add disclaimer for doc versioning Signed-off-by: bossenti <[email protected]> --- streampipes-client-python/docs/index.md | 60 +++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/streampipes-client-python/docs/index.md b/streampipes-client-python/docs/index.md index e0600c9cf..9745dcacc 100644 --- a/streampipes-client-python/docs/index.md +++ b/streampipes-client-python/docs/index.md @@ -36,10 +36,16 @@ and the amazing universe of data analytics libraries in Python. </p> <br> -**💡 The current version of this Python library is still a beta version.** -<br> -**This means that it is still heavily under development, which may result in frequent and extensive API changes, unstable behavior, etc.** -<br> +<p align="center"><b>💡 The current version of this Python library is still a beta version.<br> +This means that it is still heavily under development, which may result in frequent and extensive API changes, unstable behavior, etc.</b> +</p> +--- + +**🚧 Currently, we do not already version our Python documentation. +Therefore, the provided docs always represent the development state. +Please read our [getting started guide](./getting-started/first-steps.md) to find out how to install the development version of StreamPipes python. +We will provide a versioned documentation as soon as possible. Stay tuned!ent, which may result in frequent and extensive API changes, unstable behavior, etc.** +--- ## ⚡️ Quickstart @@ -47,31 +53,41 @@ As a quick example, we demonstrate how to set up and configure a StreamPipes cli In addition, we will get the available data lake measures out of StreamPipes. ```python ->>> 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 protected]", -... api_key = "DEMO-KEY", -... ), -... host_address = "localhost", -... http_disabled = True, -... port = 80 -...) - ->>> client = StreamPipesClient(client_config=config) +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 protected]", + api_key = "DEMO-KEY", + ), + host_address = "localhost", + http_disabled = True, + port = 80 +) + +client = StreamPipesClient(client_config=config) # get all available datat lake measures ->>> measures = client.dataLakeMeasureApi.all() +measures = client.dataLakeMeasureApi.all() # get amount of retrieved measures ->>> len(measures) +len(measures) +``` +Output: +``` 1 +``` +<br> +``` # inspect the data lake measures as pandas dataframe ->>> measures.to_pandas() +measures.to_pandas() +``` + +Output: +``` measure_name timestamp_field ... pipeline_is_running num_event_properties 0 test s0::timestamp ... False 2 [1 rows x 6 columns]
