anycoder-csvview / src /streamlit_app.py
kozo2's picture
Upload src/streamlit_app.py with huggingface_hub
73da367 verified
raw
history blame contribute delete
619 Bytes
import streamlit as st
import pandas as pd
st.set_page_config(page_title="CSV Viewer", layout="wide")
st.title("๐Ÿ“„ CSV File Viewer")
uploaded_file = st.file_uploader(
"Choose a CSV file",
type="csv",
accept_multiple_files=False,
)
if uploaded_file is not None:
try:
df = pd.read_csv(uploaded_file)
st.success(f"Loaded {uploaded_file.name} ({df.shape[0]} rows ร— {df.shape[1]} columns)")
st.dataframe(df, use_container_width=True)
except Exception as e:
st.error(f"Error reading file: {e}")
else:
st.info("Upload a CSV file to view its contents as a table.")