Using Streamlit to showcase my Excel or Google Sheets on a webpage

Hi everyone,

New user with ZERO coding experience. I came across Streamlit via a YouTube video. Nice to e-meet you all. I hope I am posting in the right place.

My requirement: I want to launch a super simple website that simply shows the data from my Excel/Google Sheets file. The audience should be able to sort the data, click on any links, etc. When I update the file, it should reflect on the LIVE site also. How do I go about doing this using Streamlit?

This is the YouTube video I have just started to watch but I do wonder if it’s going to be very complicated for a newbie like me: https://youtu.be/7zeAIEPJaoQ?si=vqh0S1WBYAB8824h

So, I am now thinking also, if it’s just easier for me to engage an expert to do the full setup for me. Is there anyone available?

Either way, looking forward to hearing from you and thank you much in advance.

Cheers,
Manoj

Hi @manojk and welcome to our community! :raised_hands:

Here are a few pointers to get you started:

To access data from your Google Sheet and display it in Streamlit, you can use a Python library like gspread.

First, you will need to set up a Google API credential, which you can learn to do through this guide. After setting it up, you should install the gspread library using the following command:

pip install gspread

Once that’s done, you should create a Python script such as this one

import streamlit as st
import gspread
from oauth2client.service_account import ServiceAccountCredentials

# Set up Google Sheets API credentials
scope = ["https://spreadsheets.google.com/feeds",'https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('path/to/your-google-credentials.json', scope)
client = gspread.authorize(creds)

# Open the Google Sheets file
spreadsheet = client.open('Your Google Sheets File Name')

# Get the first worksheet
worksheet = spreadsheet.get_worksheet(0)

# Get all values and display them with Streamlit
data = worksheet.get_all_values()
st.write(data)

Obviously, you can do much more with GSpread and Streamlit, and hopefully, this should get you started! :hugs:

Good luck!
Charly

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.