Spaces:
Sleeping
Sleeping
| 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}_") | |