Skip to content

Commit

Permalink
[#1254]: extend data lake measure endpoints get method to process que…
Browse files Browse the repository at this point in the history
…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
bossenti committed Feb 27, 2023
1 parent be1468f commit f3729b5
Show file tree
Hide file tree
Showing 13 changed files with 607 additions and 35 deletions.
2 changes: 1 addition & 1 deletion streampipes-client-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pip install git+https://github.com/apache/streampipes.git#subdirectory=streampip
>>> client.describe()

Hi there!
You are connected to a StreamPipes instance running at http://localhost: 80.
You are connected to a StreamPipes instance running at http://localhost:80.
The following StreamPipes resources are available with this client:
6x DataStreams
1x DataLakeMeasures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand All @@ -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": [
Expand All @@ -62,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"outputs": [],
"source": [
"from streampipes.client import StreamPipesClient\n",
Expand All @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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()"
],
Expand Down
Loading

0 comments on commit f3729b5

Please sign in to comment.