The GlassFlow 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.
You can install the GlassFlow Python SDK using pip:
pip install glassflow
- publish - Publish a new event into the pipeline
- consume - Consume the transformed event from the pipeline
- consume failed - Consume the events that failed from the pipeline
Publish a new event into the pipeline
import glassflow
client = glassflow.GlassFlowClient()
pipeline_client = client.pipeline_client(pipeline_id="<str value", pipeline_access_token="<str value>")
data = {} # your json event
res = pipeline_client.publish(request_body=data)
if res.status_code == 200:
print("Published sucessfully")
Consume the transformed event from the pipeline
import glassflow
client = glassflow.GlassFlowClient()
pipeline_client = client.pipeline_client(pipeline_id="<str value", pipeline_access_token="<str value>")
res = pipeline_client.consume()
if res.status_code == 200:
print(res.body.event)
If the transformation failed for any event, they are available in a failed queue. You can consume those events from the pipeline
import glassflow
client = glassflow.GlassFlowClient()
pipeline_client = client.pipeline_client(pipeline_id="<str value", pipeline_access_token="<str value>")
res = pipeline_client.consume_failed()
if res.status_code == 200:
print(res.body.event)
Follow the quickstart guide here
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.
For more detailed information on how to use the GlassFlow Python SDK, please refer to the GlassFlow Documentation. The documentation provides comprehensive guides, tutorials, and examples to help you get started with GlassFlow and make the most out of the SDK.
Anyone who wishes to contribute to this project, whether documentation, features, bug fixes, code cleanup, testing, or code reviews, is very much encouraged to do so.
-
Join the Slack channel.
-
Just raise your hand on the GitHub discussion board.
If you are unfamiliar with how to contribute to GitHub projects, here is a Get Started Guide. A full set of contribution guidelines, along with templates, are in progress.
For any questions, comments, or additional help, please reach out to us via email at help@glassflow.dev. Please check out our Q&A to get solutions for common installation problems and other issues.
To provide feedback or report a bug, please raise an issue on our issue tracker.