abcd / app.py
nvab's picture
Create app.py
b51dcb1 verified
# File 1: app.py
import streamlit as st
import pandas as pd
# Sample course data
courses = [
{
"title": "Python for Data Science",
"description": "Learn Python programming fundamentals for data science applications",
"level": "Beginner"
},
{
"title": "Machine Learning Basics",
"description": "Understanding machine learning concepts and algorithms",
"level": "Intermediate"
},
]
# Page config
st.set_page_config(
page_title="Course Search",
page_icon="πŸ”"
)
# Create the Streamlit app
st.title("πŸŽ“ Course Search")
st.write("Search through available courses")
# Create a simple search box
search_query = st.text_input("Enter keywords to search:", "")
# Simple search function
if search_query:
found_courses = False
# Convert search query to lowercase for case-insensitive search
search_query = search_query.lower()
# Search through courses
for course in courses:
# Check if search query exists in title or description
if (search_query in course["title"].lower() or
search_query in course["description"].lower()):
# Display matching course in a box
st.success("Match found!")
with st.container():
st.markdown(f"### {course['title']}")
st.write(f"πŸ“ Description: {course['description']}")
st.write(f"πŸ“Š Level: {course['level']}")
st.divider()
found_courses = True
if not found_courses:
st.warning("No courses found matching your search.")
# File 2: requirements.txt
#streamlit==1.24.0
#pandas==2.0.3