Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show example of configuring and consuming multiple data sources in .streamlit/secrets.toml #877

Open
nccurry opened this issue Nov 13, 2023 · 3 comments
Labels

Comments

@nccurry
Copy link

nccurry commented Nov 13, 2023

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.

@nccurry
Copy link
Author

nccurry commented Nov 13, 2023

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()

@sfc-gh-dmatthews
Copy link
Contributor

Thanks for the recommendation! We are continuing to update and add to our connections docs, so I'll keep this open for tracking. 😄

@nccurry
Copy link
Author

nccurry commented Jan 18, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants