-
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.
chore(python-client): rename python package to
streampipes
Signed-off-by: bossenti <[email protected]>
- Loading branch information
Showing
51 changed files
with
248 additions
and
193 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
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 |
---|---|---|
|
@@ -46,28 +46,54 @@ and the amazing universe of data analytics libraries in Python. </p> | |
As a quick example, we demonstrate how to set up and configure a StreamPipes client. | ||
|
||
```python | ||
>>> from streampipes_client.client import StreamPipesClient | ||
>>> from streampipes_client.client.client_config import StreamPipesClientConfig | ||
>>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials | ||
>> > from streampipes.client import StreamPipesClient | ||
>> > from streampipes.client.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 | ||
>> > 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) | ||
>>> client.describe() | ||
>> > client = StreamPipesClient(client_config=config) | ||
>> > client.describe() | ||
|
||
Hi there! | ||
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 | ||
Hi | ||
there! | ||
You | ||
are | ||
connected | ||
to | ||
a | ||
StreamPipes | ||
instance | ||
running | ||
at | ||
http: // localhost: 80. | ||
The | ||
following | ||
StreamPipes | ||
resources | ||
are | ||
available | ||
with this client: | ||
6 | ||
x | ||
DataStreams | ||
1 | ||
x | ||
DataLakeMeasures | ||
``` | ||
|
||
For more information about how to use the StreamPipes client visit our [introduction example](). |
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
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 |
---|---|---|
|
@@ -21,35 +21,61 @@ | |
As a quick example, we demonstrate how to set up and configure a StreamPipes client. | ||
|
||
```python | ||
>>> from streampipes_client.client import StreamPipesClient | ||
>>> from streampipes_client.client.client_config import StreamPipesClientConfig | ||
>>> from streampipes_client.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 | ||
>> > from streampipes.client import StreamPipesClient | ||
>> > from streampipes.client.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) | ||
>>> client.describe() | ||
>> > client = StreamPipesClient(client_config=config) | ||
>> > client.describe() | ||
|
||
Hi there! | ||
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 | ||
Hi | ||
there! | ||
You | ||
are | ||
connected | ||
to | ||
a | ||
StreamPipes | ||
instance | ||
running | ||
at | ||
http: // localhost: 80. | ||
The | ||
following | ||
StreamPipes | ||
resources | ||
are | ||
available | ||
with this client: | ||
6 | ||
x | ||
DataStreams | ||
1 | ||
x | ||
DataLakeMeasures | ||
``` | ||
<br> | ||
Alternatively, you can provide your credentials via environment variables. | ||
Simply define your credential provider as follows: | ||
|
||
```python | ||
>>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials | ||
>> > from streampipes.client.credential_provider import StreamPipesApiKeyCredentials | ||
|
||
StreamPipesApiKeyCredentials.from_env(username_env="USER", api_key_env="API-KEY") | ||
``` | ||
|
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 |
---|---|---|
|
@@ -36,18 +36,9 @@ and the amazing universe of data analytics libraries in Python. </p> | |
|
||
<br> | ||
|
||
** ❗❗❗IMPORTANT ❗❗❗** | ||
<br> | ||
<br> | ||
**The current version of this Python client is still in alpha phase at best.** | ||
**💡 The current version of this Python client 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> | ||
**Please consider it only as a sneak preview.** | ||
<br> | ||
<br> | ||
**❗❗❗ IMPORTANT ❗❗❗** | ||
|
||
<br> | ||
|
||
## ⚡️ Quickstart | ||
|
@@ -56,41 +47,53 @@ 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.client import StreamPipesClient | ||
>>> from streampipes_client.client.client_config import StreamPipesClientConfig | ||
>>> from streampipes_client.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 | ||
>> > from streampipes.client import StreamPipesClient | ||
>> > from streampipes.client.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) | ||
>> > 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) | ||
1 | ||
|
||
# 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 | ||
>> > measures.to_pandas() | ||
measure_name | ||
timestamp_field...pipeline_is_running | ||
num_event_properties | ||
0 | ||
test | ||
s0::timestamp... | ||
False | ||
2 | ||
[1 rows x 6 columns] | ||
``` | ||
<br> | ||
Alternatively, you can provide your credentials via environment variables. | ||
Simply define your credential provider as follows: | ||
|
||
```python | ||
>>> from streampipes_client.client.credential_provider import StreamPipesApiKeyCredentials | ||
>> > from streampipes.client.credential_provider import StreamPipesApiKeyCredentials | ||
|
||
StreamPipesApiKeyCredentials.from_env(username_env="USER", api_key_env="API-KEY") | ||
``` | ||
|
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.