Hello, I am trying to plot a specific data file from my Supabase storage bucket however when I run the code and enter the exact name of my file, my Streamlit app does nothing and I am not sure why.
import streamlit as st
import supabase
import matplotlib.pyplot as plt
import pandas as pd
# Set up Supabase client
url = "##url goes here"
key = "## key goes here"
supabase_client = supabase.create_client(url, key)
# Ask for user input
file_path = st.text_input("Enter the path to the file in the Supabase bucket: ")
# Download file
try:
data, error = supabase_client.storage.from_("mybucketname").download(file_path)
if error:
raise Exception("Error downloading file:", error)
# Read and plot the data
if file_path.endswith('.csv'):
df = pd.read_csv(data)
df.plot()
plt.show()
else:
print("Unsupported file format. Please provide a CSV file.")
except Exception as e:
print("An error occurred:", e)