# Import libraries
import streamlit as st # Streamlit library for web app development
import pandas as pd # Pandas library for data manipulation
import time # Time library for working with timestamps
from datetime import datetime # Datetime library for handling dates and times
from streamlit_autorefresh import st_autorefresh # Streamlit extension for auto-refresh
# Get current timestamp and format it for date and time
ts = time.time()
date = datetime.fromtimestamp(ts).strftime("%d-%m-%Y")
timestamp = datetime.fromtimestamp(ts).strftime("%H:%M-%S")
# Set up auto-refresh with a counter limit and interval
count = st_autorefresh(interval=2000, limit=100, key="fizzbuzzcounter")
# Display messages based on the value of the counter
if count == 0:
st.write("Count is zero")
elif count % 3 == 0 and count % 5 == 0:
st.write("FizzBuzz")
elif count % 3 == 0:
st.write("Fizz")
elif count % 5 == 0:
st.write("Buzz")
else:
st.write(f"Count: {count}")
# Read a CSV file based on the current date
df = pd.read_csv("Attendance/Attendance_" + date + ".csv")
# Display the dataframe with highlighted maximum values
st.dataframe(df.style.highlight_max(axis=0))