Spaces:
Sleeping
Sleeping
File size: 7,107 Bytes
958590b | 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | """Mock data for Job Application Simulator."""
import random
from typing import List, Dict, Any
# Sample applicant profiles
PROFILES = {
"software_engineer": {
"name": "Alex Developer",
"skills": ["Python", "JavaScript", "React", "Node.js", "SQL", "Git"],
"experience_years": 5,
"education": "BS Computer Science",
"current_role": "Mid-level Developer",
"target_roles": ["Senior Developer", "Tech Lead"],
"preferred_locations": ["Remote", "San Francisco", "New York"],
"salary_min": 120000,
"salary_max": 180000,
"resume_sections": {
"summary": "Experienced full-stack developer passionate about building scalable applications.",
"highlights": "Led migration of monolith to microservices, mentored 3 junior developers."
}
},
"data_scientist": {
"name": "Sam Data",
"skills": ["Python", "Machine Learning", "TensorFlow", "SQL", "Statistics", "R"],
"experience_years": 3,
"education": "MS Data Science",
"current_role": "Data Analyst",
"target_roles": ["Data Scientist", "ML Engineer"],
"preferred_locations": ["New York", "Remote"],
"salary_min": 130000,
"salary_max": 170000,
"resume_sections": {
"summary": "Data professional transitioning to ML engineering.",
"highlights": "Built prediction model that increased revenue by 15%."
}
},
"product_manager": {
"name": "Jordan PM",
"skills": ["Product Strategy", "Agile", "User Research", "Analytics", "Roadmapping"],
"experience_years": 4,
"education": "MBA",
"current_role": "Associate Product Manager",
"target_roles": ["Product Manager", "Senior PM"],
"preferred_locations": ["San Francisco", "Remote"],
"salary_min": 140000,
"salary_max": 200000,
"resume_sections": {
"summary": "Product manager with technical background and strong analytics skills.",
"highlights": "Launched 3 products with 2M+ users, improved retention by 25%."
}
}
}
# Sample job listings
JOBS = [
{
"id": "job_001",
"title": "Senior Python Developer",
"company": "TechCorp",
"location": "Remote",
"type": "full-time",
"salary_range": "$120k - $150k",
"required_skills": ["Python", "Django", "PostgreSQL", "AWS"],
"preferred_skills": ["Docker", "Kubernetes"],
"description": "Build scalable backend services for our SaaS platform.",
"experience_required": 5
},
{
"id": "job_002",
"title": "Full Stack Engineer",
"company": "StartupXYZ",
"location": "Remote",
"type": "full-time",
"salary_range": "$100k - $130k",
"required_skills": ["JavaScript", "React", "Node.js", "MongoDB"],
"preferred_skills": ["TypeScript", "GraphQL"],
"description": "Join our fast-growing team building the future of X.",
"experience_required": 3
},
{
"id": "job_003",
"title": "Machine Learning Engineer",
"company": "AI Labs",
"location": "San Francisco",
"type": "full-time",
"salary_range": "$150k - $180k",
"required_skills": ["Python", "TensorFlow", "Machine Learning", "MLOps"],
"preferred_skills": ["PyTorch", "Kubernetes"],
"description": "Deploy ML models at scale for production systems.",
"experience_required": 4
},
{
"id": "job_004",
"title": "Backend Developer",
"company": "FinanceApp",
"location": "New York",
"type": "full-time",
"salary_range": "$110k - $140k",
"required_skills": ["Python", "FastAPI", "SQL", "Redis"],
"preferred_skills": ["Go", "Microservices"],
"description": "Build secure financial APIs.",
"experience_required": 3
},
{
"id": "job_005",
"title": "DevOps Engineer",
"company": "CloudCo",
"location": "Remote",
"type": "full-time",
"salary_range": "$130k - $160k",
"required_skills": ["AWS", "Docker", "Kubernetes", "CI/CD"],
"preferred_skills": ["Terraform", "Python"],
"description": "Manage cloud infrastructure and CI/CD pipelines.",
"experience_required": 4
},
{
"id": "job_006",
"title": "Junior Software Developer",
"company": "LocalTech",
"location": "Chicago",
"type": "full-time",
"salary_range": "$70k - $90k",
"required_skills": ["Python", "JavaScript", "SQL"],
"preferred_skills": ["React", "Django"],
"description": "Great opportunity for developers starting their career.",
"experience_required": 1
},
{
"id": "job_007",
"title": "Data Engineer",
"company": "DataDriven",
"location": "Remote",
"type": "full-time",
"salary_range": "$120k - $150k",
"required_skills": ["Python", "Spark", "SQL", "Airflow"],
"preferred_skills": ["AWS", "Kafka"],
"description": "Build and maintain data pipelines.",
"experience_required": 3
},
{
"id": "job_008",
"title": "Product Manager",
"company": "ProductCo",
"location": "San Francisco",
"type": "full-time",
"salary_range": "$140k - $170k",
"required_skills": ["Product Strategy", "Agile", "Analytics"],
"preferred_skills": ["Technical background"],
"description": "Lead product development for our core platform.",
"experience_required": 5
}
]
def get_jobs() -> List[Dict[str, Any]]:
"""Return all available jobs."""
return JOBS
def get_job_by_id(job_id: str) -> Dict[str, Any]:
"""Get a specific job by ID."""
for job in JOBS:
if job["id"] == job_id:
return job
return None
def get_profile(name: str) -> Dict[str, Any]:
"""Get a specific profile."""
return PROFILES.get(name)
def calculate_match_score(profile: Dict[str, Any], job: Dict[str, Any]) -> float:
"""Calculate how well a profile matches a job."""
profile_skills = set(s.lower() for s in profile.get("skills", []))
required_skills = set(s.lower() for s in job.get("required_skills", []))
preferred_skills = set(s.lower() for s in job.get("preferred_skills", []))
# Required skills match (60% weight)
required_match = len(profile_skills & required_skills) / len(required_skills) if required_skills else 0
# Preferred skills match (20% weight)
preferred_match = len(profile_skills & preferred_skills) / len(preferred_skills) if preferred_skills else 0
# Experience match (20% weight)
exp_required = job.get("experience_required", 0)
exp_actual = profile.get("experience_years", 0)
exp_match = min(exp_actual / exp_required, 1.0) if exp_required > 0 else 1.0
score = (required_match * 0.6) + (preferred_match * 0.2) + (exp_match * 0.2)
return round(score, 2)
|