Skip to content

Commit

Permalink
updated sdk docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish Bagri committed Apr 4, 2024
1 parent ad75c0e commit 4503463
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Welcome to GlassFlow Python SDK Docs

The GlassFlow Python SDK provides a convenient way to interact with the GlassFlow API in your Python applications. It can be used to publish and consume events to your GlassFlow pipelines
The [GlassFlow](https://www.glassflow.dev/) Python SDK provides a convenient way to interact with the GlassFlow API in your Python applications. The SDK is used to publish and consume events to your [GlassFlow pipelines](https://learn.glassflow.dev/docs/concepts/pipeline-configuration).


## Installation
Expand All @@ -15,6 +15,7 @@ pip install glassflow

* [publish](#publish) - Publish a new event into the pipeline
* [consume](#consume) - Consume the transformed event from the pipeline
* [consume failed](#consume-failed) - Consume the events that failed from the pipeline


## publish
Expand Down Expand Up @@ -47,13 +48,30 @@ import glassflow

client = glassflow.GlassFlowClient()
pipeline_client = client.pipeline_client(space_id="<str value>", pipeline_id="<str value")
data = {} # your json event
res = pipeline_client.consume(pipeline_access_token="<str value>")

if res.status_code == 200:
print(res.body.event)
```


## consume failed

If the transformation failed for any event, they are available in a failed queue. You can consume those events from the pipeline

### Example Usage

```python
import glassflow

client = glassflow.GlassFlowClient()
pipeline_client = client.pipeline_client(space_id="<str value>", pipeline_id="<str value")
res = pipeline_client.consume_failed(pipeline_access_token="<str value>")

if res.status_code == 200:
print(res.body.event)
```

## SDK Maturity

Please note that the GlassFlow Python SDK is currently in beta and is subject to potential breaking changes. We recommend keeping an eye on the official documentation and updating your code accordingly to ensure compatibility with future versions of the SDK.
Expand Down

0 comments on commit 4503463

Please sign in to comment.