Skip to content

sidhulabs/streamlit-elasticsearch-connection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamlit Elasticsearch Connection

Connect to a Elasticsearch cluster from your Streamlit app. Powered by st.experimental_connection() and Elasticsearch.

Example App

Install

pip install streamlit git+https://github.com/sidhulabs/streamlit-elasticsearch-connection  

Example

Setup your .streamlit/secrets.toml. You must specify one of the following:

  • hosts
  • cloud_id

For auth methods, you must either use:

  • a username or password
  • api id and api key.
# .streamlit/secrets.toml

[connections.elasticsearch]
cloud_id = "..."
# hosts = "..."

user = "..."
password = "..."

# api_id = "..."
# api_key = "..."

Then in your streamlit script:

# main.py

import streamlit as st
from elasticsearch_connection import ElasticsearchConnection

conn = st.experimental_connection("elasticsearch", type=ElasticsearchConnection)

df = conn.query("kibana_sample_data_flights")
st.dataframe(data)

Q&A

Does this work for hosted or cloud clusters?

It works for both.

About

Streamlit connection to Elasticsearch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages