|
|
import streamlit as st |
|
|
import pandas as pd |
|
|
|
|
|
|
|
|
data = { |
|
|
"Tag ID": [1, 2, 3, 4, 5], |
|
|
"Breed": ["Gir", "Hf", "Jersey", "Sahiwal", "Rati"], |
|
|
"Age": [3, 4, 2, 5, 3], |
|
|
"Health History": [ |
|
|
["Surgery", "2 Reproduction Cycles", "Healthy"], |
|
|
["Surgery", "3 Reproduction Cycles", "Injured"], |
|
|
["No Surgery", "1 Reproduction Cycle", "Healthy"], |
|
|
["Surgery", "5 Reproduction Cycles", "Healthy"], |
|
|
["No Surgery", "2 Reproduction Cycles", "Injured"] |
|
|
] |
|
|
} |
|
|
|
|
|
|
|
|
df = pd.DataFrame(data) |
|
|
|
|
|
|
|
|
def display_rfid_info(tag_id): |
|
|
|
|
|
cow_info = df[df['Tag ID'] == tag_id].iloc[0] |
|
|
|
|
|
|
|
|
st.subheader(f"Details for RFID Tag ID: {tag_id}") |
|
|
st.write(f"**Breed**: {cow_info['Breed']}") |
|
|
st.write(f"**Age**: {cow_info['Age']} years") |
|
|
|
|
|
|
|
|
st.write("**Health History**:") |
|
|
for history in cow_info['Health History']: |
|
|
st.checkbox(history, value=True) |
|
|
|
|
|
|
|
|
def app(): |
|
|
st.title("RFID Cattle Health Dashboard") |
|
|
|
|
|
|
|
|
tag_id = st.selectbox("Select RFID Tag ID", df['Tag ID'].tolist()) |
|
|
|
|
|
|
|
|
display_rfid_info(tag_id) |
|
|
|
|
|
if __name__ == '__main__': |
|
|
app() |
|
|
|