Summary
Hi guys ,
I have a problem about the retrive of a shared Google Docs file from Google Drive and display the content of file on streamlit in a pretty way. Can you help me?
Steps to reproduce
Code snippet:
Example of my script:
import streamlit as st
import gspread
from oauth2client.service_account import ServiceAccountCredentials
# Set up Google API credentials
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name("your-credentials.json", scope)
client = gspread.authorize(creds)
# Access the Google Sheet
sheet_url = "https://docs.google.com/spreadsheets/d/1OBEMIUloci4WV80D-yLhhoLMVQymy-TYlh7jwGXmND8/edit#gid=0"
worksheet = client.open_by_url(sheet_url).sheet1
# Read data from the worksheet
data = worksheet.get_all_values()
# Display data in Streamlit
st.write(data)
I expect to have the text of the document in streamlit to display in different way.
Thank you for your support!
bye
Matt