docs
docs copied to clipboard
Show example of configuring and consuming multiple data sources in .streamlit/secrets.toml
Link to doc page in question (if any): https://github.com/streamlit/docs/blob/main/content/kb/tutorials/databases/public-gsheet.md
Name of the Streamlit feature whose docs need improvement: Any Datasource, Google Sheets in my case.
What you think the docs should say: They should describe how to configure multiple data sources and consume them simultaneously.
For example
# .streamlit/secrets.toml
[connections.name_one]
type = "gsheets"
spreadsheet = "https://docs.google.com/spreadsheets/d/xxxxxxx/edit#gid=0"
[connections.name_two]
type = "gsheets"
spreadsheet = "https://docs.google.com/spreadsheets/d/xxxxxxx/edit#gid=0"
# streamlit_app.py
import streamlit as st
from streamlit_gsheets import GSheetsConnection
# Create a connection object for the first spreadsheet
conn_one = st.connection("name_one", type=GSheetsConnection)
df_one = conn_one.read()
# Create a connection object for the second spreadsheet
conn_two = st.connection("name_two", type=GSheetsConnection)
df_two = conn_two.read()
Thanks for the recommendation! We are continuing to update and add to our connections docs, so I'll keep this open for tracking. 😄
Thanks!