-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresume_parser.py
More file actions
32 lines (25 loc) · 921 Bytes
/
resume_parser.py
File metadata and controls
32 lines (25 loc) · 921 Bytes
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
# resume_parser.py
import PyPDF2
def parse_resume(pdf_path):
# Extract text from PDF
with open(pdf_path, 'rb') as file:
reader = PyPDF2.PdfFileReader(file)
text = ""
for page_num in range(reader.numPages):
page = reader.getPage(page_num)
text += page.extract_text()
# Example: Simple parsing logic (to be enhanced)
resume_data = {
'skills': extract_skills(text),
'experience': extract_experience(text)
}
return resume_data
def extract_skills(text):
# Placeholder function for skill extraction
return ["Python", "Data Analysis"]
def extract_experience(text):
# Placeholder function for experience extraction
return "3 years of experience in data analysis and machine learning."
if __name__ == "__main__":
resume_data = parse_resume('sample_resume.pdf')
print("Parsed Resume Data:", resume_data)