Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix example code & add disclaimer for doc versioning #1364

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 38 additions & 22 deletions streampipes-client-python/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,58 @@ 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!**
---

## ⚡️ Quickstart

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.

```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 = "test@streampipes.apache.org",
... 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 = "test@streampipes.apache.org",
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]
Expand Down