Spaces:
Sleeping
Sleeping
Download sample_data/generate_sample_data.py from AnishDev/coderound-task-backend: direct link, hf CLI and curl.
- Browser
- Download file 25.9 kB
-
https://huggingface.co/spaces/AnishDev/coderound-task-backend/resolve/a7a9afe3f947e70477a823d02e69e2edf3292376/sample_data/generate_sample_data.py
- Command line
-
hf download hf://spaces/AnishDev/coderound-task-backend@a7a9afe3f947e70477a823d02e69e2edf3292376/sample_data/generate_sample_data.py
-
curl -L -o generate_sample_data.py https://huggingface.co/spaces/AnishDev/coderound-task-backend/resolve/a7a9afe3f947e70477a823d02e69e2edf3292376/sample_data/generate_sample_data.py
25.9 kB
| """ | |
| Generates sample_candidates.xlsx for testing the JD Candidate Matching System. | |
| Run from the sample_data/ directory: | |
| python generate_sample_data.py | |
| Produces: sample_candidates.xlsx (15 candidates, mix of AI and Backend Engineers) | |
| Column schema matches the expected XLSX format: | |
| name, parsed_skills, parsed_summary, parsed_work_experience, | |
| parsed_metadata_calculated_years_experience, engineer_type, | |
| current_position, current_title, gen_ai_experience, | |
| is_actively_or_passively_looking, parsed_metadata_most_recent_company, | |
| notice_period | |
| """ | |
| import openpyxl | |
| from openpyxl.styles import Font, PatternFill, Alignment | |
| from pathlib import Path | |
| def we(company, role, duration, description): | |
| """Format a single work experience entry as Python dict literal.""" | |
| desc = description.replace("'", "\\'") | |
| return f"{{'company': '{company}', 'role': '{role}', 'duration': '{duration}', 'description': '{desc}'}}" | |
| CANDIDATES = [ | |
| # ββ AI Engineers βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| { | |
| "id": "AI-001", | |
| "name": "Priya Sharma", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "Senior AI Engineer", | |
| "current_title": "Senior AI Engineer", | |
| "parsed_metadata_calculated_years_experience": 5.5, | |
| "parsed_metadata_most_recent_company": "Google India", | |
| "gen_ai_experience": "2+ years", | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "30 days", | |
| "parsed_skills": ( | |
| "Python (Expert), LangChain (Advanced), RAG pipelines (Advanced), " | |
| "PyTorch (Advanced), HuggingFace Transformers (Advanced), " | |
| "FastAPI (Core), Vector Databases - Pinecone FAISS (Advanced), " | |
| "LLM fine-tuning (Core), AWS SageMaker (Core), Docker (Core)" | |
| ), | |
| "parsed_summary": ( | |
| "AI Engineer with 5+ years building production ML systems. " | |
| "Led RAG pipeline for Google Search quality team. " | |
| "Published research on LLM evaluation metrics." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Google India", "Senior AI Engineer", "2.5 years", | |
| "Led RAG pipeline design serving 10M queries/day. Fine-tuned LLaMA 3 on domain-specific corpora. " | |
| "Built LangChain agents for automated QA. Used Pinecone for vector search. Deployed on GCP Vertex AI."), | |
| we("Flipkart AI Labs", "ML Engineer", "2 years", | |
| "Built recommendation models using PyTorch. Developed FastAPI inference service. " | |
| "RAG-based product Q&A system using FAISS. LLM prompt engineering for catalog enrichment."), | |
| we("Infosys AI Studio", "Junior ML Engineer", "1 year", | |
| "Trained NLP classification models with HuggingFace. Deployed models on AWS SageMaker. " | |
| "Experimented with GPT-3 embeddings for semantic search."), | |
| ]), | |
| }, | |
| { | |
| "id": "AI-002", | |
| "name": "Rahul Mehta", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "AI Engineer", | |
| "current_title": "AI Engineer", | |
| "parsed_metadata_calculated_years_experience": 4.0, | |
| "parsed_metadata_most_recent_company": "Swiggy", | |
| "gen_ai_experience": "1.5 years - 2 years", | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "45 days", | |
| "parsed_skills": ( | |
| "Python (Core), TensorFlow (Advanced), FastAPI (Core), " | |
| "LangChain (Basic), OpenAI API (Core), " | |
| "PostgreSQL (Core), Redis (Basic), Docker (Basic), AWS (Basic)" | |
| ), | |
| "parsed_summary": ( | |
| "AI Engineer at Swiggy building demand forecasting and LLM-powered " | |
| "chatbot systems. Experience with LLM APIs and RAG architectures." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Swiggy", "AI Engineer", "2 years", | |
| "Built LLM-powered customer support chatbot using OpenAI GPT-4 and LangChain. " | |
| "Integrated RAG with Redis vector store. Developed FastAPI endpoints for real-time inference. " | |
| "Demand forecasting using TensorFlow time-series models."), | |
| we("Ola Electric", "Data Scientist", "2 years", | |
| "Built anomaly detection models for battery management. " | |
| "Developed Python ETL pipelines and SQL dashboards. " | |
| "First LLM experiment: GPT-3 for log summarisation."), | |
| ]), | |
| }, | |
| { | |
| "id": "AI-003", | |
| "name": "Ananya Patel", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "Principal AI Engineer", | |
| "current_title": "Principal AI Engineer", | |
| "parsed_metadata_calculated_years_experience": 7.0, | |
| "parsed_metadata_most_recent_company": "Microsoft India", | |
| "gen_ai_experience": "2+ years", | |
| "is_actively_or_passively_looking": False, | |
| "notice_period": "60 days", | |
| "parsed_skills": ( | |
| "Python (Expert), LangChain (Expert), LangGraph (Advanced), " | |
| "RAG (Expert), Vector Databases (Expert), LLM fine-tuning (Advanced), " | |
| "Azure OpenAI (Expert), HuggingFace (Advanced), FastAPI (Advanced), " | |
| "Kubernetes (Core), MLflow (Core)" | |
| ), | |
| "parsed_summary": ( | |
| "Principal AI Engineer at Microsoft with 7 years in ML/AI. " | |
| "Architect of Azure OpenAI enterprise integrations. " | |
| "Expert in multi-agent LangGraph systems and production RAG." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Microsoft India", "Principal AI Engineer", "3 years", | |
| "Architected enterprise RAG systems using Azure OpenAI and Cognitive Search. " | |
| "Built multi-agent LangGraph workflows for document processing. " | |
| "Led team of 8 engineers. LLM fine-tuning on proprietary datasets. " | |
| "Pinecone and Weaviate for vector search at scale."), | |
| we("Samsung Research", "Senior ML Engineer", "2.5 years", | |
| "Built on-device NLP models using HuggingFace and PyTorch. " | |
| "Generative AI for Bixby voice assistant. " | |
| "Fine-tuned LLaMA models for multilingual tasks."), | |
| we("Mu Sigma", "ML Engineer", "1.5 years", | |
| "Statistical ML models for retail analytics. Python, scikit-learn, FastAPI."), | |
| ]), | |
| }, | |
| { | |
| "id": "AI-004", | |
| "name": "Sneha Iyer", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "ML Engineer", | |
| "current_title": "ML Engineer", | |
| "parsed_metadata_calculated_years_experience": 3.5, | |
| "parsed_metadata_most_recent_company": "Freshworks", | |
| "gen_ai_experience": "6 months - 1 year", | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "30 days", | |
| "parsed_skills": ( | |
| "Python (Core), scikit-learn (Advanced), FastAPI (Basic), " | |
| "LangChain (Basic), OpenAI API (Basic), " | |
| "SQL (Core), pandas (Core), Docker (Basic)" | |
| ), | |
| "parsed_summary": ( | |
| "ML Engineer at Freshworks. Recently started exploring LLMs and GenAI. " | |
| "Strong classical ML background, transitioning to GenAI workloads." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Freshworks", "ML Engineer", "2 years", | |
| "Built NLP models for customer sentiment analysis using scikit-learn. " | |
| "Developed FastAPI endpoints for ML inference. " | |
| "Started exploring LangChain for RAG-based knowledge base. " | |
| "Used OpenAI API for text classification experiments."), | |
| we("Tata Consultancy Services", "Software Engineer", "1.5 years", | |
| "Developed Python data pipelines. SQL reporting. Some ML model training."), | |
| ]), | |
| }, | |
| { | |
| "id": "AI-005", | |
| "name": "Vikram Nair", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "Software Engineer", | |
| "current_title": "Software Engineer", | |
| "parsed_metadata_calculated_years_experience": 2.5, | |
| "parsed_metadata_most_recent_company": "Wipro", | |
| "gen_ai_experience": "only internship/project experience", | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "15 days", | |
| "parsed_skills": ( | |
| "Python (Basic), scikit-learn (Basic), TensorFlow (Basic), " | |
| "pandas (Core), SQL (Core), REST APIs (Basic)" | |
| ), | |
| "parsed_summary": ( | |
| "Software Engineer pivoting to AI/ML. " | |
| "Completed LLM project during internship. " | |
| "Eager to grow in GenAI space." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Wipro", "Software Engineer", "2.5 years", | |
| "Backend Java development. REST APIs. Some Python scripting for data tasks. " | |
| "Built a small text classifier using scikit-learn as a side project."), | |
| ]), | |
| }, | |
| { | |
| "id": "AI-006", | |
| "name": "Divya Krishnan", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "Research Engineer", | |
| "current_title": "AI Research Engineer", | |
| "parsed_metadata_calculated_years_experience": 4.5, | |
| "parsed_metadata_most_recent_company": "IIT Bangalore AI Lab", | |
| "gen_ai_experience": "2+ years", | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "30 days", | |
| "parsed_skills": ( | |
| "Python (Expert), PyTorch (Expert), HuggingFace Transformers (Expert), " | |
| "LLM fine-tuning (Advanced), RLHF (Core), " | |
| "FAISS (Advanced), LangChain (Core), FastAPI (Core), " | |
| "CUDA (Basic), MLflow (Core)" | |
| ), | |
| "parsed_summary": ( | |
| "Research Engineer specializing in LLM fine-tuning and RLHF. " | |
| "Published 2 papers on instruction-tuned models. " | |
| "Strong PyTorch and HuggingFace expertise." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("IIT Bangalore AI Lab", "Research Engineer", "2 years", | |
| "Fine-tuned LLaMA 2 and Mistral models using RLHF and LoRA. " | |
| "Built RAG evaluation benchmarks using FAISS and LangChain. " | |
| "Published research on hallucination mitigation in LLMs. " | |
| "Generative AI for code generation tasks."), | |
| we("Anthropic (Intern)", "AI Safety Research Intern", "6 months", | |
| "Red-teaming Claude models. Prompt injection research. Constitutional AI experiments."), | |
| we("Samsung Research", "ML Engineer", "2 years", | |
| "On-device transformer models with HuggingFace. MLflow for experiment tracking. " | |
| "FastAPI for model serving. RAG prototype using FAISS."), | |
| ]), | |
| }, | |
| { | |
| "id": "AI-007", | |
| "name": "Arjun Bose", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "Data Scientist", | |
| "current_title": "Senior Data Scientist", | |
| "parsed_metadata_calculated_years_experience": 6.0, | |
| "parsed_metadata_most_recent_company": "Paytm", | |
| "gen_ai_experience": "1 to 1.5 years", | |
| "is_actively_or_passively_looking": False, | |
| "notice_period": "90 days", | |
| "parsed_skills": ( | |
| "Python (Expert), XGBoost (Expert), TensorFlow (Core), " | |
| "SQL (Expert), Spark (Core), AWS (Core), " | |
| "OpenAI API (Basic), LangChain (Basic)" | |
| ), | |
| "parsed_summary": ( | |
| "Senior Data Scientist at Paytm with strong classical ML background. " | |
| "Recently began integrating LLMs into fraud detection pipeline. " | |
| "More DS than AI Engineer profile." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Paytm", "Senior Data Scientist", "3 years", | |
| "Built fraud detection models with XGBoost. A/B testing frameworks. " | |
| "Recently added LLM-based transaction explanation using OpenAI API. " | |
| "LangChain for internal audit Q&A chatbot."), | |
| we("HDFC Bank", "Data Analyst", "3 years", | |
| "SQL reporting and Python data pipelines. Credit risk models."), | |
| ]), | |
| }, | |
| # ββ Backend Engineers βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| { | |
| "id": "BE-001", | |
| "name": "Kiran Kumar", | |
| "engineer_type": "Backend Engineer", | |
| "current_position": "Senior Backend Engineer", | |
| "current_title": "Senior Backend Engineer", | |
| "parsed_metadata_calculated_years_experience": 6.0, | |
| "parsed_metadata_most_recent_company": "Razorpay", | |
| "gen_ai_experience": "i do not have gen ai experience", | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "30 days", | |
| "parsed_skills": ( | |
| "Node.js (Expert), Express.js (Expert), AWS (Advanced), " | |
| "PostgreSQL (Advanced), Redis (Advanced), " | |
| "Microservices (Advanced), Docker (Advanced), " | |
| "Kubernetes (Core), REST APIs (Expert), GraphQL (Core)" | |
| ), | |
| "parsed_summary": ( | |
| "Senior Backend Engineer at Razorpay. 6 years building high-throughput " | |
| "payment APIs. Expert in Node.js microservices on AWS." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Razorpay", "Senior Backend Engineer", "3 years", | |
| "Led backend for payment gateway handling 50K TPS. Node.js microservices on AWS ECS. " | |
| "PostgreSQL + Redis for transaction state. Built GraphQL API layer. " | |
| "Kafka for event streaming between services."), | |
| we("PhonePe", "Backend Engineer", "2 years", | |
| "Node.js Express APIs for UPI payment flows. " | |
| "Redis caching for session management. PostgreSQL sharding. Docker deployment."), | |
| we("Cognizant", "Software Engineer", "1 year", | |
| "Java Spring Boot backend. REST API development. MySQL. Agile team."), | |
| ]), | |
| }, | |
| { | |
| "id": "BE-002", | |
| "name": "Meera Joshi", | |
| "engineer_type": "Backend Engineer", | |
| "current_position": "Backend Engineer", | |
| "current_title": "Backend Engineer", | |
| "parsed_metadata_calculated_years_experience": 4.0, | |
| "parsed_metadata_most_recent_company": "Zomato", | |
| "gen_ai_experience": None, | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "45 days", | |
| "parsed_skills": ( | |
| "Node.js (Advanced), Express.js (Advanced), MongoDB (Advanced), " | |
| "PostgreSQL (Core), Redis (Core), AWS (Core), " | |
| "Docker (Core), REST APIs (Advanced), Microservices (Core)" | |
| ), | |
| "parsed_summary": ( | |
| "Backend Engineer at Zomato. Strong Node.js and Express expertise. " | |
| "Built food delivery order management APIs serving millions of users." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Zomato", "Backend Engineer", "2.5 years", | |
| "Built order management microservices in Node.js/Express. " | |
| "MongoDB for order storage. Redis for caching menu data. " | |
| "AWS Lambda for async order events. REST APIs consumed by mobile apps."), | |
| we("MakeMyTrip", "Junior Backend Engineer", "1.5 years", | |
| "Node.js APIs for hotel booking. PostgreSQL. Docker containers."), | |
| ]), | |
| }, | |
| { | |
| "id": "BE-003", | |
| "name": "Arjun Singh", | |
| "engineer_type": "Backend Engineer", | |
| "current_position": "Tech Lead", | |
| "current_title": "Backend Tech Lead", | |
| "parsed_metadata_calculated_years_experience": 8.0, | |
| "parsed_metadata_most_recent_company": "Zerodha", | |
| "gen_ai_experience": "i do not have gen ai experience", | |
| "is_actively_or_passively_looking": False, | |
| "notice_period": "90 days", | |
| "parsed_skills": ( | |
| "Node.js (Expert), Express.js (Expert), AWS (Expert), " | |
| "PostgreSQL (Expert), DynamoDB (Advanced), Redis (Advanced), " | |
| "Microservices (Expert), Docker (Expert), Kubernetes (Advanced), " | |
| "REST APIs (Expert), System Design (Expert)" | |
| ), | |
| "parsed_summary": ( | |
| "Tech Lead at Zerodha (India's largest stock broker). " | |
| "8 years of backend experience. Led architecture of trading platform " | |
| "backend serving 10M users." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Zerodha", "Backend Tech Lead", "4 years", | |
| "Architected Node.js microservices for stock trading platform. " | |
| "AWS EKS for container orchestration. DynamoDB for order book. " | |
| "PostgreSQL for account management. Redis Cluster for real-time positions. " | |
| "Led team of 12 backend engineers."), | |
| we("CRED", "Senior Backend Engineer", "2.5 years", | |
| "High-performance REST APIs in Node.js/Express. AWS + Kubernetes deployment. " | |
| "PostgreSQL with read replicas. Redis caching."), | |
| we("Infosys", "Software Engineer", "1.5 years", | |
| "Java Spring Boot. REST APIs. MySQL. Agile development."), | |
| ]), | |
| }, | |
| { | |
| "id": "BE-004", | |
| "name": "Kavya Reddy", | |
| "engineer_type": "Backend Engineer", | |
| "current_position": "Backend Engineer", | |
| "current_title": "Software Engineer - Backend", | |
| "parsed_metadata_calculated_years_experience": 3.0, | |
| "parsed_metadata_most_recent_company": "OYO Rooms", | |
| "gen_ai_experience": None, | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "30 days", | |
| "parsed_skills": ( | |
| "Node.js (Core), Express.js (Advanced), MongoDB (Advanced), " | |
| "AWS (Basic), Docker (Basic), REST APIs (Advanced)" | |
| ), | |
| "parsed_summary": ( | |
| "Backend Engineer at OYO with 3 years Node.js experience. " | |
| "Solid Express and MongoDB skills. Limited cloud exposure." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("OYO Rooms", "Backend Engineer", "2 years", | |
| "Node.js/Express APIs for hotel inventory management. " | |
| "MongoDB for property data. REST APIs for mobile apps. " | |
| "Basic AWS EC2 deployment."), | |
| we("Wipro", "Junior Developer", "1 year", | |
| "Python and Node.js scripting. REST API testing. QA tasks."), | |
| ]), | |
| }, | |
| { | |
| "id": "BE-005", | |
| "name": "Dev Agarwal", | |
| "engineer_type": "Backend Engineer", | |
| "current_position": "Junior Backend Developer", | |
| "current_title": "Backend Developer", | |
| "parsed_metadata_calculated_years_experience": 1.5, | |
| "parsed_metadata_most_recent_company": "Startup XYZ", | |
| "gen_ai_experience": None, | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "15 days", | |
| "parsed_skills": ( | |
| "Node.js (Basic), Express.js (Basic), MongoDB (Basic), " | |
| "REST APIs (Basic), JavaScript (Core)" | |
| ), | |
| "parsed_summary": ( | |
| "Junior backend developer with 1.5 years experience. " | |
| "Learning Node.js and Express. Early in career." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Startup XYZ", "Junior Backend Developer", "1.5 years", | |
| "Node.js Express REST APIs for e-commerce app. MongoDB CRUD operations. " | |
| "Basic deployment on Heroku."), | |
| ]), | |
| }, | |
| # ββ Edge Cases ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| { | |
| "id": "EDGE-001", | |
| "name": "Rohan Verma", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "Fresh Graduate", | |
| "current_title": None, | |
| "parsed_metadata_calculated_years_experience": None, # years_unknown | |
| "parsed_metadata_most_recent_company": None, | |
| "gen_ai_experience": "only internship/project experience", | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "Immediate", | |
| "parsed_skills": ( | |
| "Python (Basic), TensorFlow (Basic), scikit-learn (Basic), " | |
| "LangChain (Basic), SQL (Basic)" | |
| ), | |
| "parsed_summary": ( | |
| "Recent CS graduate. Built a RAG chatbot as final year project using LangChain. " | |
| "Eager to start career in AI Engineering." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("University Project", "AI Intern", "6 months", | |
| "Built RAG-based document Q&A using LangChain and FAISS. " | |
| "Experimented with LLM prompt engineering. Python, FastAPI for serving."), | |
| ]), | |
| }, | |
| { | |
| "id": "EDGE-002", | |
| "name": "Pooja Gupta", | |
| "engineer_type": "Frontend Engineer", # wrong type for AI JD | |
| "current_position": "Frontend Developer", | |
| "current_title": "React Developer", | |
| "parsed_metadata_calculated_years_experience": 4.0, | |
| "parsed_metadata_most_recent_company": "Accenture", | |
| "gen_ai_experience": "i do not have gen ai experience", | |
| "is_actively_or_passively_looking": False, | |
| "notice_period": "30 days", | |
| "parsed_skills": ( | |
| "React (Expert), JavaScript (Expert), TypeScript (Advanced), " | |
| "Next.js (Advanced), CSS (Expert), REST APIs (Core)" | |
| ), | |
| "parsed_summary": ( | |
| "Senior Frontend Developer specializing in React and Next.js. " | |
| "No backend or AI experience." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("Accenture", "Frontend Developer", "4 years", | |
| "React and Next.js UI development. TypeScript. REST API integration. CSS animations."), | |
| ]), | |
| }, | |
| { | |
| "id": "EDGE-003", | |
| "name": "Siddharth Rao", | |
| "engineer_type": "AI Engineer", | |
| "current_position": "AI Engineer", | |
| "current_title": "AI Engineer", | |
| "parsed_metadata_calculated_years_experience": 3.0, | |
| "parsed_metadata_most_recent_company": "TCS", | |
| "gen_ai_experience": "2+ years", # claims 2+ years but work history won't support it | |
| "is_actively_or_passively_looking": True, | |
| "notice_period": "60 days", | |
| "parsed_skills": ( | |
| "Python (Core), SQL (Core), pandas (Core), " | |
| "Excel (Advanced), PowerPoint (Advanced)" | |
| ), | |
| "parsed_summary": ( | |
| "AI Engineer at TCS with self-reported 2+ years GenAI experience. " | |
| "Work history reveals primarily data analyst tasks, not AI engineering." | |
| ), | |
| "parsed_work_experience": ", ".join([ | |
| we("TCS", "Business Analyst", "3 years", | |
| "Data analysis using SQL and Excel. PowerPoint presentations for clients. " | |
| "Python scripting for data cleanup. No LLM or ML model work."), | |
| ]), | |
| }, | |
| ] | |
| def build_workbook(): | |
| wb = openpyxl.Workbook() | |
| ws = wb.active | |
| ws.title = "Candidates" | |
| headers = [ | |
| "id", "name", "engineer_type", "current_position", "current_title", | |
| "parsed_metadata_calculated_years_experience", | |
| "parsed_metadata_most_recent_company", | |
| "gen_ai_experience", "is_actively_or_passively_looking", "notice_period", | |
| "parsed_skills", "parsed_summary", "parsed_work_experience", | |
| ] | |
| # Header row styling | |
| header_fill = PatternFill("solid", fgColor="1F4E79") | |
| header_font = Font(bold=True, color="FFFFFF", size=11) | |
| for col_idx, header in enumerate(headers, start=1): | |
| cell = ws.cell(row=1, column=col_idx, value=header) | |
| cell.fill = header_fill | |
| cell.font = header_font | |
| cell.alignment = Alignment(horizontal="center", vertical="center") | |
| # Data rows | |
| row_fill_a = PatternFill("solid", fgColor="EBF3FB") | |
| row_fill_b = PatternFill("solid", fgColor="FFFFFF") | |
| wrap = Alignment(wrap_text=True, vertical="top") | |
| for row_idx, cand in enumerate(CANDIDATES, start=2): | |
| fill = row_fill_a if row_idx % 2 == 0 else row_fill_b | |
| values = [ | |
| cand.get("id"), | |
| cand.get("name"), | |
| cand.get("engineer_type"), | |
| cand.get("current_position"), | |
| cand.get("current_title"), | |
| cand.get("parsed_metadata_calculated_years_experience"), | |
| cand.get("parsed_metadata_most_recent_company"), | |
| cand.get("gen_ai_experience"), | |
| cand.get("is_actively_or_passively_looking"), | |
| cand.get("notice_period"), | |
| cand.get("parsed_skills"), | |
| cand.get("parsed_summary"), | |
| cand.get("parsed_work_experience"), | |
| ] | |
| for col_idx, value in enumerate(values, start=1): | |
| cell = ws.cell(row=row_idx, column=col_idx, value=value) | |
| cell.fill = fill | |
| cell.alignment = wrap | |
| # Column widths | |
| widths = [12, 20, 18, 22, 22, 10, 22, 20, 10, 12, 60, 50, 120] | |
| for col_idx, width in enumerate(widths, start=1): | |
| ws.column_dimensions[ws.cell(row=1, column=col_idx).column_letter].width = width | |
| ws.row_dimensions[1].height = 20 | |
| ws.freeze_panes = "A2" | |
| return wb | |
| if __name__ == "__main__": | |
| out_path = Path(__file__).parent / "sample_candidates.xlsx" | |
| wb = build_workbook() | |
| wb.save(out_path) | |
| print(f"Generated: {out_path}") | |
| print(f"Total candidates: {len(CANDIDATES)}") | |
| types = {} | |
| for c in CANDIDATES: | |
| t = c["engineer_type"] | |
| types[t] = types.get(t, 0) + 1 | |
| for t, n in types.items(): | |
| print(f" {t}: {n}") | |