-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1254]: extend data lake measure endpoints get method to process que…
…ry parameters (#1349) * feature(#1254): add query parameters for get endpoint for measurements Signed-off-by: bossenti <[email protected]> * feature(#1254): add examples for query parameters Signed-off-by: bossenti <[email protected]> * chore: update example notebooks Signed-off-by: bossenti <[email protected]> * chore: add missing update of unit tests Signed-off-by: bossenti <[email protected]> * chore: add missing file headers Signed-off-by: bossenti <[email protected]> * chore: fix typo Signed-off-by: bossenti <[email protected]> * chore: fix typos Signed-off-by: bossenti <[email protected]> * feature(#1254): add examples to docs Signed-off-by: bossenti <[email protected]> * chore: add demo for initial setup Signed-off-by: bossenti <[email protected]> * chore: fix formatting Signed-off-by: bossenti <[email protected]> --------- Signed-off-by: bossenti <[email protected]>
- Loading branch information
Showing
13 changed files
with
607 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ | |
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# Introduction to StreamPipes Python Client\n", | ||
"# Introduction to StreamPipes Python\n", | ||
"\n", | ||
"<br>\n", | ||
"\n", | ||
"### Why there is an extra Python client for StreamPipes\n", | ||
"### Why there is an extra Python library for StreamPipes?\n", | ||
"[Apache StreamPipes](https://streampipes.apache.org/) aims to enable non-technical users to connect and analyze IoT data streams.\n", | ||
"To this end, it provides an easy-to-use and convenient user interface that allows one to connect to an IoT data source and create some visual\n", | ||
"graphs within a few minutes. <br>\n", | ||
|
@@ -20,10 +20,7 @@ | |
"\n", | ||
"<br>\n", | ||
"\n", | ||
"### How to install the Python client\n", | ||
"Up to this point, we do not provide a release of the Python client in any of the package indexes known for Python.\n", | ||
"This will probably start with StreamPipes `1.0.0` when we officially launch the Python client.\n", | ||
"Until then, you can just install the currently available development version of the client directly from GitHub.\n", | ||
"### How to install StreamPipes Python?\n", | ||
"Simply use the following `pip` command:" | ||
], | ||
"metadata": { | ||
|
@@ -35,14 +32,38 @@ | |
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"%pip install streampipes\n", | ||
"%pip install streampipes\n" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"# if you want to have the current development state you can also execute\n", | ||
"%pip install git+https://github.com/apache/streampipes.git#subdirectory=streampipes-client-python" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"### How to prepare the tutorials\n", | ||
"In case you want to reproduce the first two tutorials exactly on your end, you need to create a simple pipeline in StreamPipes like demonstrated below.\n", | ||
"\n", | ||
"![tutorial-preparation](https://raw.githubusercontent.com/apache/streampipes/dev/streampipes-client-python/docs/img/tutorial-preparation.gif)\n", | ||
"\n", | ||
"<br>" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
|
@@ -62,7 +83,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"from streampipes.client import StreamPipesClient\n", | ||
|
@@ -81,7 +102,7 @@ | |
"config = StreamPipesClientConfig(\n", | ||
" credential_provider=StreamPipesApiKeyCredentials(\n", | ||
" username=\"[email protected]\",\n", | ||
" api_key=\"DEMO-KEY\",\n", | ||
" api_key=\"API-KEY\",\n", | ||
" ),\n", | ||
" host_address=\"localhost\",\n", | ||
" https_disabled=True,\n", | ||
|
@@ -121,7 +142,27 @@ | |
"source": [ | ||
"Please note that you pass the names of the environment variables.\n", | ||
"To ensure that the above code works, you must set the environment variables with the same name you specified in `from_env`.\n", | ||
"\n", | ||
"In this scenario this would look like the following:" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"source": [ | ||
"%export USER=\"<USERNAME>\"\n", | ||
"%export" | ||
], | ||
"metadata": { | ||
"collapsed": false | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"Having the `config` ready, we can now initialize the actual client." | ||
], | ||
"metadata": { | ||
|
@@ -150,8 +191,23 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"outputs": [], | ||
"execution_count": 6, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"2023-02-24 17:05:49,398 - streampipes.endpoint.endpoint - [INFO] - [endpoint.py:167] [_make_request] - Successfully retrieved all resources.\n", | ||
"2023-02-24 17:05:49,457 - streampipes.endpoint.endpoint - [INFO] - [endpoint.py:167] [_make_request] - Successfully retrieved all resources.\n", | ||
"\n", | ||
"Hi there!\n", | ||
"You are connected to a StreamPipes instance running at http://localhost:80.\n", | ||
"The following StreamPipes resources are available with this client:\n", | ||
"1x DataLakeMeasures\n", | ||
"1x DataStreams\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"client.describe()" | ||
], | ||
|
Oops, something went wrong.