Streamlit

Streamlit is a Python library that enables the simple creation of web apps.

A video walkthrough can be found below:

Introduction

There is no direct connection to DuckDB from any Apache Kafka-compliant service. However, a DuckDB plug-in named Kwack provides this ability. This guide will explain how to connect the two systems together to allow you to perform analytics on your WarpStream-managed Topics.

Prerequisites

  1. Have Python 3.x or later installed

  2. Have the Streamlit Python library installed: pip install streamlit

  3. Have Confluent Kafka Python library installed: pip install confluent_kafka

  4. WarpStream account - get access to WarpStream by registering here.

  5. A Serverless WarpStream cluster is up and running with a populated topic.

Step 1: Python Code

The following Python program can be used as is. It will present a web page that will:

  • Prompt for your cluster credentials

  • Ask for a number of records to display

  • Present a list of available topics

  • Print out the requested number of records from the topic

Step 2: Run the app

From the command line, the program can be run as follows:

streamlit run myapp.py

Next, open a web browser and paste in the following URL:

Which will present you with the following screen:

Enter the applicable information. If Topics are available, they will be displayed, and you can then preview records from them. This app is generic, so any valid set of credentials will connect and allow you to browse the topics and data in your cluster.

Next Steps

Congratulations! You now have a general-purpose Streamlit app that will allow you to quickly peruse the structure and data in your WarpStream cluster.

Last updated

Was this helpful?