This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 28ea9a1a12 docs: correct definitions, broken link and grammar,
capitalization, punctuation in python client documentation (#2940)
28ea9a1a12 is described below
commit 28ea9a1a1260fe97bef6f5ae9ffec9bfe7a5d89d
Author: raphaelbalzer <[email protected]>
AuthorDate: Tue Jun 18 22:36:12 2024 +0200
docs: correct definitions, broken link and grammar, capitalization,
punctuation in python client documentation (#2940)
---
...introduction-to-streampipes-python-client.ipynb | 8 ++++----
...cting-data-from-the-streampipes-data-lake.ipynb | 12 ++++++------
...roperable-machine-learning-in-streampipes.ipynb | 2 +-
.../streampipes/client/client.py | 2 +-
.../streampipes/client/credential_provider.py | 2 +-
.../streampipes/endpoint/api/data_lake_measure.py | 8 ++++----
.../streampipes/endpoint/api/version.py | 4 ++--
.../streampipes/endpoint/endpoint.py | 6 +++---
.../streampipes/endpoint/exceptions.py | 2 +-
.../streampipes/functions/streampipes_function.py | 12 ++++++------
.../streampipes/model/common.py | 22 +++++++++++-----------
.../model/container/resource_container.py | 2 +-
12 files changed, 41 insertions(+), 41 deletions(-)
diff --git
a/streampipes-client-python/docs/tutorials/1-introduction-to-streampipes-python-client.ipynb
b/streampipes-client-python/docs/tutorials/1-introduction-to-streampipes-python-client.ipynb
index c7efd9a81f..50eb8c3dfe 100644
---
a/streampipes-client-python/docs/tutorials/1-introduction-to-streampipes-python-client.ipynb
+++
b/streampipes-client-python/docs/tutorials/1-introduction-to-streampipes-python-client.ipynb
@@ -7,9 +7,9 @@
"\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",
+ "To achieve this, 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",
- "Although this is the main use case of Apache StreamPipes, it can also
provide great value for people who are eager to work on data analysis or data
science with IoT data, but don't we do get in touch with all the hassle
associated with extracting data from devices in a suitable format.\n",
+ "While this is the primary use case for Apache StreamPipes, it also offers
significant value to those interested in data analysis or data science with IoT
data, without the need to handle the complexities of extracting data from
devices in a suitable format.\n",
"In this scenario, StreamPipes helps you connect to your data source and
extract the data for you.\n",
"You then can make the data available outside StreamPipes by writing it
into an external source, such as a database, Kafka, etc.\n",
"While this requires another component, you can also extract your data
directly from StreamPipes programmatically using the StreamPipes API.\n",
@@ -87,7 +87,7 @@
"source": [
"### How to configure the Python client\n",
"In order to access the resources available in StreamPipes, one must be
able to authenticate against the backend.\n",
- "For this purpose, the client sofar only supports the authentication via
an API token that can be generated via the StreamPipes UI, as you see below.\n",
+ "For this purpose, the client so far only supports the authentication via
an API token that can be generated via the StreamPipes UI, as you can see
below.\n",
"\n",
"\n",
"\n",
@@ -159,7 +159,7 @@
"cell_type": "markdown",
"source": [
"To ensure that the above code works, you must set the environment
variables as expected.\n",
- "This can be done like following:"
+ "This can be done as follows:"
],
"metadata": {
"collapsed": false
diff --git
a/streampipes-client-python/docs/tutorials/2-extracting-data-from-the-streampipes-data-lake.ipynb
b/streampipes-client-python/docs/tutorials/2-extracting-data-from-the-streampipes-data-lake.ipynb
index 000f6fa96f..af3c0dc4b9 100644
---
a/streampipes-client-python/docs/tutorials/2-extracting-data-from-the-streampipes-data-lake.ipynb
+++
b/streampipes-client-python/docs/tutorials/2-extracting-data-from-the-streampipes-data-lake.ipynb
@@ -121,7 +121,7 @@
{
"cell_type": "markdown",
"source": [
- "So let's see how many measures are available"
+ "So let's see how many measures are available:"
],
"metadata": {
"collapsed": false
@@ -179,7 +179,7 @@
{
"cell_type": "markdown",
"source": [
- "To get a more comprehensive overview, you can take a look at the
[`pandas`](https://pandas.pydata.org/) representation"
+ "To get a more comprehensive overview, you can take a look at the
[`pandas`](https://pandas.pydata.org/) representation:"
],
"metadata": {
"collapsed": false
@@ -318,7 +318,7 @@
{
"cell_type": "markdown",
"source": [
- "As a final step, we want to create a plot of both attributes"
+ "As a final step, we want to create a plot of both attributes."
],
"metadata": {
"collapsed": false
@@ -469,10 +469,10 @@
{
"cell_type": "markdown",
"source": [
- "... from this point on we leave all future processing of the data up to
your creativity.\n",
+ "... from this point on, we leave all future processing of the data up to
your creativity.\n",
"Keep in mind: the general syntax used in this tutorial (`all()`,
`to_pandas()`, `get()`) applies to all endpoints and associated resources of
the StreamPipes Python client.\n",
"\n",
- "If you get further and create exiting stuff with data extracted from
StreamPipes please [let us
know](https://github.com/apache/streampipes/discussions/categories/show-and-tell).\n",
+ "If you get further and create exciting stuff with data extracted from
StreamPipes please [let us
know](https://github.com/apache/streampipes/discussions/categories/show-and-tell).\n",
"We are thrilled to see what you as a community will build with the
provided client.\n",
"Furthermore, don't hesitate to discuss [feature
requests](https://github.com/apache/streampipes/discussions/812) to extend the
current functionality with us."
],
@@ -483,7 +483,7 @@
{
"cell_type": "markdown",
"source": [
- "For now, that's all about the StreamPipes client. Read the next tutorial
([Getting live data from the StreamPipes data
stream](../3-getting-live-data-from-the-streampipes-data-stream)) if you are
interested in making use of the powerful [StreamPipes
functions](https://streampipes.apache.org/docs/docs/extend-sdk-functions.html)
to interact with StreamPipes event-based."
+ "For now, that's all about the StreamPipes client. Read the next tutorial
([Getting live data from the StreamPipes data
stream](../3-getting-live-data-from-the-streampipes-data-stream)) if you are
interested in making use of the powerful [StreamPipes
functions](https://streampipes.apache.org/docs/extend-sdk-functions.html) to
interact with StreamPipes in an event-based manner."
],
"metadata": {
"collapsed": false
diff --git
a/streampipes-client-python/docs/tutorials/5-applying-interoperable-machine-learning-in-streampipes.ipynb
b/streampipes-client-python/docs/tutorials/5-applying-interoperable-machine-learning-in-streampipes.ipynb
index f1b055aed4..70cff543a5 100644
---
a/streampipes-client-python/docs/tutorials/5-applying-interoperable-machine-learning-in-streampipes.ipynb
+++
b/streampipes-client-python/docs/tutorials/5-applying-interoperable-machine-learning-in-streampipes.ipynb
@@ -381,7 +381,7 @@
"source": [
"Let's dive a little deeper into the different parts of the function\n",
"\n",
- "- **`__init__`**: First, we need to take care about the data stream that
is required to send the predictions from our function to StreamPipes. Thus, we
create a dedicated output data stream which we need to provide with the
attributes our event will consist of (a timestamp attribute is always added
automatically). This output data stream needs to be registered at the function
definition which is to be passed to the parent class. Lastly, we need to define
some instance variables that [...]
+ "- **`__init__`**: First, we need to take care of the data stream that is
required to send the predictions from our function to StreamPipes. Thus, we
create a dedicated output data stream which we need to provide with the
attributes our event will consist of (a timestamp attribute is always added
automatically). This output data stream needs to be registered at the function
definition which is to be passed to the parent class. Lastly, we need to define
some instance variables that ar [...]
"\n",
"- **`onServiceStarted`**: Here we prepare the ONNX runtime session by
creating an `InferenceSession` and retrieving the corresponding configuration
parameters.\n",
"\n",
diff --git a/streampipes-client-python/streampipes/client/client.py
b/streampipes-client-python/streampipes/client/client.py
index 047e52cc89..c150b6d24c 100644
--- a/streampipes-client-python/streampipes/client/client.py
+++ b/streampipes-client-python/streampipes/client/client.py
@@ -230,7 +230,7 @@ class StreamPipesClient:
Returns
-------
http_headers: Dict[str, str]
- header information for HTTP requests as string key-value pairs.
+ Header information for HTTP requests as string key-value pairs.
"""
# create HTTP headers from credential provider and add additional
headers needed
diff --git
a/streampipes-client-python/streampipes/client/credential_provider.py
b/streampipes-client-python/streampipes/client/credential_provider.py
index d7493b40c2..f2fd843b4d 100644
--- a/streampipes-client-python/streampipes/client/credential_provider.py
+++ b/streampipes-client-python/streampipes/client/credential_provider.py
@@ -112,7 +112,7 @@ class StreamPipesApiKeyCredentials(CredentialProvider):
def from_env(cls, username_env: str, api_key_env: str) ->
StreamPipesApiKeyCredentials:
"""DEPRECATED - use the class constructor instead
- Returns an api key provider parameterized via environment variables.
+ Returns an API key provider parameterized via environment variables.
Parameters
----------
diff --git
a/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py
b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py
index 0bdf256002..7751334052 100644
--- a/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py
+++ b/streampipes-client-python/streampipes/endpoint/api/data_lake_measure.py
@@ -55,7 +55,7 @@ class MeasurementGetQueryConfig(BaseModel):
If provided, the returned data only consists of the given columns.<br>
Please be aware that the column `time` as an index is always included.
end_date: Optional[datetime]
- Restricts queried data to be younger than the specified time.
+ Limits the queried data to only include data that is older than the
specified time. In other words, any data that occurred after the end_date will
not be included in the query results.
limit: Optional[int]
Amount of records returned at maximum (default: `1000`) <br>
This needs to be at least `1`
@@ -69,7 +69,7 @@ class MeasurementGetQueryConfig(BaseModel):
Page number used for paging operation <br>
This needs to be at least `1`
start_date: Optional[datetime]
- Restricts queried data to be older than the specified time
+ Limits the queried data to only include data that is newer than the
specified time. In other words, any data that occurred before the start_date
will not be included in the query results.
"""
_regex_comma_separated_string = r"^[0-9a-zA-Z\_]+(,[0-9a-zA-Z\_]+)*$"
@@ -344,14 +344,14 @@ class DataLakeMeasureEndpoint(APIEndpoint):
identifier: str
The identifier of the data lake measure to be queried.
**kwargs: Dict[str, Any]
- keyword arguments can be used to provide additional query
parameters.
+ Keyword arguments can be used to provide additional query
parameters.
The available query parameters are defined by the
[MeasurementGetQueryConfig][streampipes.endpoint.api.data_lake_measure.MeasurementGetQueryConfig].
Returns
-------
measurement: DataLakeMeasures
- the specified data lake measure
+ The specified data lake measure
Examples
--------
diff --git a/streampipes-client-python/streampipes/endpoint/api/version.py
b/streampipes-client-python/streampipes/endpoint/api/version.py
index fb06583e3a..0b21544850 100644
--- a/streampipes-client-python/streampipes/endpoint/api/version.py
+++ b/streampipes-client-python/streampipes/endpoint/api/version.py
@@ -105,7 +105,7 @@ class VersionEndpoint(APIEndpoint):
Raises
------
NotImplementedError
- this endpoint does not return multiple entries, therefore this
method is not available
+ This endpoint does not return multiple entries, therefore this
method is not available.
"""
raise NotImplementedError("The `all()` method is not supported by this
endpoint.")
@@ -147,7 +147,7 @@ class VersionEndpoint(APIEndpoint):
Raises
------
NotImplementedError
- this endpoint does not allow for POST requests, therefore this
method is not available
+ This endpoint does not allow for POST requests, therefore this
method is not available.
"""
raise NotImplementedError("The `post()` method is not supported by
this endpoint.")
diff --git a/streampipes-client-python/streampipes/endpoint/endpoint.py
b/streampipes-client-python/streampipes/endpoint/endpoint.py
index fb70fbf41a..2c491c6dd1 100644
--- a/streampipes-client-python/streampipes/endpoint/endpoint.py
+++ b/streampipes-client-python/streampipes/endpoint/endpoint.py
@@ -18,7 +18,7 @@
"""
General implementation for an endpoint.
Provided classes and assets are aimed to be used for developing endpoints.
-An endpoint provides all options to communicate with ad dedicated part of
StreamPipes in a handy way.
+An endpoint provides all options to communicate with a dedicated part of
StreamPipes in a handy way.
"""
import json
@@ -184,7 +184,7 @@ class APIEndpoint(Endpoint):
Returns
-------
container: ResourceContainer
- container element that bundles the returned resources
+ Container element that bundles the returned resources
"""
response = self._make_request(
@@ -284,7 +284,7 @@ class MessagingEndpoint(Endpoint):
"""Configures the message endpoint by setting the broker instance to
be used.
This configuration step is required before the endpoint can be
actually used.
- The based `broker` instance is passed to an internal property
+ The based `broker` instance is passed to an internal property.
Parameters
----------
diff --git a/streampipes-client-python/streampipes/endpoint/exceptions.py
b/streampipes-client-python/streampipes/endpoint/exceptions.py
index 6465146f92..6803a836f4 100644
--- a/streampipes-client-python/streampipes/endpoint/exceptions.py
+++ b/streampipes-client-python/streampipes/endpoint/exceptions.py
@@ -16,7 +16,7 @@
#
"""
-Custom exceptions dedicated for the endpoints module
+Custom exceptions dedicated to the endpoints module.
"""
__all__ = [
diff --git
a/streampipes-client-python/streampipes/functions/streampipes_function.py
b/streampipes-client-python/streampipes/functions/streampipes_function.py
index 90521f1934..8d3c063768 100644
--- a/streampipes-client-python/streampipes/functions/streampipes_function.py
+++ b/streampipes-client-python/streampipes/functions/streampipes_function.py
@@ -34,7 +34,7 @@ class StreamPipesFunction(ABC):
Parameters
----------
function_definition: FunctionDefinition
- the definition of the function that contains metadata about the
connected function
+ The definition of the function that contains metadata about the
connected function
Attributes
----------
@@ -50,7 +50,7 @@ class StreamPipesFunction(ABC):
}
def add_output(self, stream_id: str, event: Dict[str, Any]):
- """Send an event via an output data stream to StreamPipes
+ """Send an event via an output data stream to StreamPipes.
Parameters
----------
@@ -78,7 +78,7 @@ class StreamPipesFunction(ABC):
return self.function_definition.function_id
def stop(self) -> None:
- """Stops the function and disconnects from the output streams"""
+ """Stops the function and disconnects from the output streams."""
for collector in self.output_collectors.values():
collector.disconnect()
@@ -96,12 +96,12 @@ class StreamPipesFunction(ABC):
@abstractmethod
def onServiceStarted(self, context: FunctionContext) -> None:
- """Is called when the function gets started.
+ """Is called when the function is started.
Parameters
----------
context: FunctionContext
- The context in which the function gets started.
+ The context in which the function is started.
Returns
-------
@@ -128,7 +128,7 @@ class StreamPipesFunction(ABC):
@abstractmethod
def onServiceStopped(self) -> None:
- """Is called when the function gets stopped.
+ """Is called when the function is stopped.
Returns
-------
diff --git a/streampipes-client-python/streampipes/model/common.py
b/streampipes-client-python/streampipes/model/common.py
index 49cd58caad..f1e36225c7 100644
--- a/streampipes-client-python/streampipes/model/common.py
+++ b/streampipes-client-python/streampipes/model/common.py
@@ -82,14 +82,14 @@ class BasicModel(BaseModel):
class BaseElement(BasicModel):
- """Structure of a basic element in the StreamPipes backend"""
+ """Structure of a basic element in the StreamPipes Backend."""
element_id: Optional[StrictStr]
class ValueSpecification(BasicModel):
"""
- Data model of an `ValueSpecification` in compliance to the StreamPipes
Backend.
+ Data model of an `ValueSpecification` in compliance with the StreamPipes
Backend.
"""
class_name: Optional[StrictStr] = Field(alias="@class")
@@ -101,7 +101,7 @@ class ValueSpecification(BasicModel):
class EventProperty(BasicModel):
"""
- Data model of an `EventProperty` in compliance to the StreamPipes Backend.
+ Data model of an `EventProperty` in compliance with the StreamPipes
Backend.
"""
class_name: StrictStr = Field(alias="@class",
default="org.apache.streampipes.model.schema.EventPropertyPrimitive")
@@ -121,7 +121,7 @@ class EventProperty(BasicModel):
class EventSchema(BasicModel):
"""
- Data model of an `EventSchema` in compliance to the StreamPipes Backend.
+ Data model of an `EventSchema` in compliance with the StreamPipes Backend.
"""
event_properties: List[EventProperty]
@@ -129,7 +129,7 @@ class EventSchema(BasicModel):
class ApplicationLink(BasicModel):
"""
- Data model of an `ApplicationLink` in compliance to the StreamPipes
Backend.
+ Data model of an `ApplicationLink` in compliance with the StreamPipes
Backend.
"""
class_name: Optional[StrictStr] = Field(alias="@class")
@@ -143,7 +143,7 @@ class ApplicationLink(BasicModel):
class TopicDefinition(BasicModel):
"""
- Data model of a `TopicDefinition` in compliance to the StreamPipes Backend.
+ Data model of a `TopicDefinition` in compliance with the StreamPipes
Backend.
"""
class_name: Optional[StrictStr] = Field(
@@ -154,7 +154,7 @@ class TopicDefinition(BasicModel):
class TransportProtocol(BasicModel):
"""
- Data model of a `TransportProtocol` in compliance to the StreamPipes
Backend.
+ Data model of a `TransportProtocol` in compliance with the StreamPipes
Backend.
"""
class_name: StrictStr = Field(
@@ -168,7 +168,7 @@ class TransportProtocol(BasicModel):
class TransportFormat(BasicModel):
"""
- Data model of a `TransportFormat` in compliance to the StreamPipes Backend.
+ Data model of a `TransportFormat` in compliance with the StreamPipes
Backend.
"""
rdf_type: List[StrictStr] =
Field(default=["http://sepa.event-processing.org/sepa#json"])
@@ -176,7 +176,7 @@ class TransportFormat(BasicModel):
class EventGrounding(BasicModel):
"""
- Data model of an `EventGrounding` in compliance to the StreamPipes Backend.
+ Data model of an `EventGrounding` in compliance to with StreamPipes
Backend.
"""
transport_protocols: List[TransportProtocol] =
Field(default_factory=lambda: [TransportProtocol()])
@@ -185,7 +185,7 @@ class EventGrounding(BasicModel):
class MeasurementCapability(BasicModel):
"""
- Data model of a `MeasurementCapability` in compliance to the StreamPipes
Backend.
+ Data model of a `MeasurementCapability` in compliance with the StreamPipes
Backend.
"""
capability: Optional[StrictStr]
@@ -194,7 +194,7 @@ class MeasurementCapability(BasicModel):
class MeasurementObject(BasicModel):
"""
- Data model of a `MeasurementObject` in compliance to the StreamPipes
Backend.
+ Data model of a `MeasurementObject` in compliance with the StreamPipes
Backend.
"""
element_id: Optional[StrictStr]
diff --git
a/streampipes-client-python/streampipes/model/container/resource_container.py
b/streampipes-client-python/streampipes/model/container/resource_container.py
index b86a0c5ff8..03c017319e 100644
---
a/streampipes-client-python/streampipes/model/container/resource_container.py
+++
b/streampipes-client-python/streampipes/model/container/resource_container.py
@@ -166,7 +166,7 @@ class ResourceContainer(ABC):
Returns
-------
container: ResourceContainer
- instance of the container derived from the JSON definition
+ Instance of the container derived from the JSON definition
Raises
------