File size: 1,145 Bytes
85381ee
 
 
f851b83
8aeb067
85381ee
f851b83
 
 
 
85381ee
f851b83
 
 
 
 
 
85381ee
 
 
 
 
f851b83
 
85381ee
f851b83
 
 
 
 
 
 
 
85381ee
 
 
f851b83
 
 
 
8aeb067
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import streamlit as st
import pandas as pd

# Load the Excel sheet
@st.cache_data
def load_data(file_path):
    # Load and clean the data
    df = pd.read_excel(file_path)
    df.columns = df.columns.str.strip()  # Remove extra spaces
    return df

# Load the data
data = load_data("students_data.xlsx")  # Replace with your actual path

# Debugging
st.write("Available Columns:", data.columns)
st.write("Sample Data:", data.head())

# Streamlit UI
st.title('Student Information System')

# Input fields
student_name = st.text_input('Enter Student Name')
father_name = st.text_input('Enter Father Name')

# Search
if st.button('Search'):
    if student_name and father_name:
        # Normalize and search
        result = data[
            (data['Student Name'].str.strip().str.lower() == student_name.strip().lower()) &
            (data['Father Name'].str.strip().str.lower() == father_name.strip().lower())
        ]
        if not result.empty:
            st.write(result)
        else:
            st.error('No records found. Please check the inputs.')
    else:
        st.warning('Please provide both Student Name and Father Name.')