my_first_space / app.py
IqraFatima's picture
Update app.py
0a1563c verified
import streamlit as st
# ---- PAGE CONFIG ----
st.set_page_config(page_title="Smart Career Advisor", layout="centered")
st.title("πŸŽ“ Smart Career Advisor")
st.markdown("Get career suggestions based on your background, interests, and goals.")
# ---- USER INPUT ----
with st.form("career_form"):
name = st.text_input("πŸ‘€ Your Name")
age = st.slider("πŸŽ‚ Age", 15, 60, 22)
education_level = st.selectbox("πŸŽ“ Highest Education Level", [
"High School", "Diploma", "Bachelor's Degree", "Master's Degree", "PhD"
])
field_of_study = st.text_input("πŸ“˜ Field of Study (e.g., Computer Science, Business)")
interests = st.multiselect("🧠 Interests", [
"Technology", "Art", "Business", "Medicine", "Design", "Law", "Education",
"Engineering", "Writing", "Finance", "Environment"
])
future_goals = st.text_area("🌟 Your Future Goals", placeholder="Describe your long-term career goals")
work_style = st.radio("πŸ’Ό Preferred Work Style", ["Remote", "On-site", "Hybrid", "Flexible"])
hobbies = st.text_input("🎯 Any hobbies that could relate to your career?")
submitted = st.form_submit_button("Get Career Suggestions")
# ---- LOGIC ----
def recommend_paths(education, field, interests, goals, style):
suggestions = []
# Tech
if "Technology" in interests or "Engineering" in interests:
suggestions.append({
"Career Path": "Software Development",
"Job Roles": ["Frontend Developer", "Backend Developer", "DevOps Engineer"],
"Learning Resources": [
"freeCodeCamp.org", "Coursera – Python for Everybody", "CS50 by Harvard"
],
"Why": "Combines your interest in technology and problem-solving."
})
# Design
if "Design" in interests or "Art" in interests:
suggestions.append({
"Career Path": "UI/UX Design",
"Job Roles": ["UX Researcher", "UI Designer", "Interaction Designer"],
"Learning Resources": ["Google UX Design on Coursera", "Figma", "Adobe XD Tutorials"],
"Why": "Blends creativity with user-centric thinking."
})
# Business
if "Business" in interests or "Finance" in interests:
suggestions.append({
"Career Path": "Business Analytics",
"Job Roles": ["Data Analyst", "Product Manager", "Business Consultant"],
"Learning Resources": ["Google Data Analytics", "Khan Academy – Economics", "LinkedIn Learning"],
"Why": "Great for strategic thinking and data-driven decision making."
})
# Education
if "Education" in interests:
suggestions.append({
"Career Path": "Educational Technology",
"Job Roles": ["Instructional Designer", "EdTech Developer"],
"Learning Resources": ["EdX – Learning Design", "TeachThought", "Coursera – EdTech"],
"Why": "Perfect for knowledge sharing and innovation in learning."
})
# Medicine
if "Medicine" in interests:
suggestions.append({
"Career Path": "Healthcare Technology",
"Job Roles": ["Medical Technologist", "Health Data Analyst", "Bioinformatician"],
"Learning Resources": ["Health Informatics – Coursera", "WHO Health Courses", "Bioinformatics 101"],
"Why": "Connects science with improving patient care."
})
return suggestions
# ---- OUTPUT ----
if submitted:
st.success(f"Hi {name}, here are your personalized career suggestions πŸ‘‡")
recommendations = recommend_paths(
education_level, field_of_study, interests, future_goals, work_style
)
if recommendations:
for idx, rec in enumerate(recommendations):
with st.container():
st.subheader(f"πŸ”Ή Suggestion {idx+1}: {rec['Career Path']}")
st.markdown(f"**Why this fits you:** {rec['Why']}")
st.markdown("**Potential Job Roles:**")
st.write(", ".join(rec["Job Roles"]))
st.markdown("**Learning Resources to Get Started:**")
for res in rec["Learning Resources"]:
st.write(f"πŸ”— {res}")
else:
st.warning("We couldn't generate a match from your current inputs. Try adding more interests!")
# Extra: show a future motivation message
st.markdown("---")
st.info(f"🎯 Keep pushing towards your goal: _{future_goals}_")