-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate_cvs.py
More file actions
254 lines (236 loc) · 8.48 KB
/
Copy pathgenerate_cvs.py
File metadata and controls
254 lines (236 loc) · 8.48 KB
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
from fpdf import FPDF
import os
import random
# Create directory
output_dir = "dummy_resumes"
if not os.path.exists(output_dir):
os.makedirs(output_dir)
# Profiles
profiles = [
# PERFECT MATCHES (Python + React + Senior)
{
"name": "Kamal Perera",
"email": "kamal.perera@example.com",
"phone": "+94 77 123 4567",
"role": "Senior Full Stack Engineer",
"summary": "Senior Software Engineer with 6 years of experience in Python (FastAPI/Django) and React. Expert in AWS and Docker.",
"skills": ["Python", "React", "FastAPI", "PostgreSQL", "AWS", "Docker", "TypeScript", "Tailwind CSS"],
"exp": "6 years at TechCorp. Built scalable microservices.",
},
{
"name": "Sarah Jenkins",
"email": "sarah.j@example.com",
"phone": "+1 555 0199",
"role": "Lead Developer",
"summary": "Full Stack Developer specializing in Python and React. 7 years experience.",
"skills": ["Python", "Django", "React", "Redux", "Azure", "CI/CD"],
"exp": "Lead dev leading a team of 5.",
},
{
"name": "Nuwan Pradeep",
"email": "nuwan.p@example.com",
"phone": "+94 71 222 3333",
"role": "Senior Python/React Dev",
"summary": "Passionate developer with strong background in Python backend and React frontend.",
"skills": ["Python", "Flask", "React", "Next.js", "MongoDB", "Kubernetes"],
"exp": "5 years building SaaS products.",
},
{
"name": "David Miller",
"email": "david.m@example.com",
"phone": "+44 7700 900077",
"role": "Full Stack Architect",
"summary": "Architecting cloud-native solutions using Python and React.",
"skills": ["Python", "FastAPI", "React", "GraphQL", "AWS Lambda", "Terraform"],
"exp": "8 years in software architecture.",
},
{
"name": "Priya Sharma",
"email": "priya.s@example.com",
"phone": "+91 98765 43210",
"role": "Senior Software Engineer",
"summary": "Expert in Python backends and modern Javascript frontends.",
"skills": ["Python", "React.js", "PostgreSQL", "Redis", "Celery"],
"exp": "5.5 years experience.",
},
# GOOD MATCHES (Either Strong Python OR Strong React, or slightly junior)
{
"name": "Kasun Kalhara",
"email": "kasun.k@example.com",
"phone": "+94 70 111 2222",
"role": "Frontend Engineer",
"summary": "React specialist with some Python knowledge.",
"skills": ["React", "Redux", "TypeScript", "JavaScript", "HTML", "CSS", "Basic Python"],
"exp": "4 years focused on frontend.",
},
{
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+1 555 1234",
"role": "Backend Engineer",
"summary": "Python expert. Love building APIs.",
"skills": ["Python", "Django", "Flask", "SQLAlchemy", "PostgreSQL", "API Design"],
"exp": "4 years backend focused.",
},
{
"name": "Nimali Silva",
"email": "nimali.s@example.com",
"phone": "+94 76 555 6666",
"role": "Full Stack Developer",
"summary": "3 years experience in Python and React.",
"skills": ["Python", "React", "MySQL", "Git"],
"exp": "3 years experience. Looking for senior role.",
},
{
"name": "James Wilson",
"email": "james.w@example.com",
"phone": "+1 555 8888",
"role": "Python Developer",
"summary": "Strong Python skills, learning React.",
"skills": ["Python", "Pandas", "NumPy", "Basic React"],
"exp": "3 years in Data Science turned Web Dev.",
},
{
"name": "Isuru Udana",
"email": "isuru.u@example.com",
"phone": "+94 77 999 0000",
"role": "Web Developer",
"summary": "Web developer with experience in MERN stack, willing to switch to Python.",
"skills": ["React", "Node.js", "Express", "MongoDB", "JavaScript"],
"exp": "4 years with Node.js.",
},
# WEAK MATCHES (Junior, Wrong Stack)
{
"name": "Saman Kumara",
"email": "saman.k@example.com",
"phone": "+94 71 000 1111",
"role": "Junior Developer",
"summary": "Fresh graduate looking for first job.",
"skills": ["Java", "C++", "Basic Python", "HTML"],
"exp": "Internship experience only.",
},
{
"name": "Emily Rose",
"email": "emily.r@example.com",
"phone": "+1 555 3333",
"role": "Java Developer",
"summary": "Enterprise Java developer.",
"skills": ["Java", "Spring Boot", "Hibernate", "Oracle"],
"exp": "5 years in Banking sector.",
},
{
"name": "Robert Brown",
"email": "robert.b@example.com",
"phone": "+1 555 4444",
"role": ".NET Developer",
"summary": "C# and .NET Core expert.",
"skills": ["C#", ".NET", "Azure", "MSSQL"],
"exp": "6 years Microsoft stack.",
},
{
"name": "Chathuri Bandara",
"email": "chathuri.b@example.com",
"phone": "+94 75 123 1234",
"role": "PHP Developer",
"summary": "WordPress and Laravel developer.",
"skills": ["PHP", "Laravel", "MySQL", "jQuery"],
"exp": "4 years in web agency.",
},
{
"name": "Michael Chang",
"email": "michael.c@example.com",
"phone": "+1 555 7777",
"role": "Frontend Dev",
"summary": "Angular and Vue.js expert.",
"skills": ["Angular", "Vue.js", "TypeScript", "SCSS"],
"exp": "5 years.",
},
# MISMATCHES (Non-Tech)
{
"name": "Dilshan Perera",
"email": "dilshan.p@example.com",
"phone": "+94 71 555 4444",
"role": "Accountant",
"summary": "Experienced Accountant with CPA.",
"skills": ["Accounting", "Excel", "QuickBooks", "Taxation"],
"exp": "7 years in finance.",
},
{
"name": "Jessica Lee",
"email": "jessica.l@example.com",
"phone": "+1 555 6666",
"role": "Marketing Manager",
"summary": "Digital Marketing specialist.",
"skills": ["SEO", "Content Marketing", "Google Ads", "Social Media"],
"exp": "5 years.",
},
{
"name": "Ruwan Silva",
"email": "ruwan.s@example.com",
"phone": "+94 77 333 3333",
"role": "Chef",
"summary": "Executive Chef specializing in Italian cuisine.",
"skills": ["Cooking", "Menu Planning", "Food Safety"],
"exp": "10 years.",
},
{
"name": "Linda White",
"email": "linda.w@example.com",
"phone": "+1 555 2222",
"role": "HR Manager",
"summary": "Human Resources professional.",
"skills": ["Recruitment", "Employee Relations", "Labor Law"],
"exp": "8 years.",
},
{
"name": "Amara Gunawardena",
"email": "amara.g@example.com",
"phone": "+94 71 888 9999",
"role": "Driver",
"summary": "Professional Driver.",
"skills": ["Driving", "Vehicle Maintenance"],
"exp": "15 years.",
},
]
class PDF(FPDF):
def header(self):
self.set_font('Arial', 'B', 15)
self.cell(0, 10, 'Curriculum Vitae', 0, 1, 'C')
self.ln(5)
def chapter_title(self, title):
self.set_font('Arial', 'B', 12)
self.set_fill_color(200, 220, 255)
self.cell(0, 6, title, 0, 1, 'L', 1)
self.ln(4)
def chapter_body(self, body):
self.set_font('Arial', '', 11)
self.multi_cell(0, 5, body)
self.ln()
print(f"Generating {len(profiles)} resumes...")
for p in profiles:
pdf = PDF()
pdf.add_page()
# Name
pdf.set_font('Arial', 'B', 16)
pdf.cell(0, 10, p["name"], 0, 1)
# Contact
pdf.set_font('Arial', '', 10)
pdf.cell(0, 5, f"Email: {p['email']}", 0, 1)
pdf.cell(0, 5, f"Phone: {p['phone']}", 0, 1)
pdf.ln(10)
# Role
pdf.chapter_title("Professional Summary")
pdf.chapter_body(f"{p['role']}\n\n{p['summary']}")
# Skills
pdf.chapter_title("Key Skills")
pdf.chapter_body(", ".join(p["skills"]))
# Experience
pdf.chapter_title("Experience")
pdf.chapter_body(p["exp"])
# Education (Generic)
pdf.chapter_title("Education")
pdf.chapter_body("Bachelor's Degree in Computer Science / Related Field\nUniversity of Technology (2015-2019)")
filename = f"{p['name'].replace(' ', '_')}_Resume.pdf"
pdf.output(os.path.join(output_dir, filename))
print(f"Created {filename}")
print("Done! Check 'dummy_resumes' folder.")