File size: 1,675 Bytes
b51dcb1 |
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# 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 |