Spaces:
Paused
Paused
File size: 1,075 Bytes
504df0f |
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 |
import os
from pyresparser import ResumeParser
def extract_resume_features(resume_path):
"""
Extract features from a resume file.
Args:
resume_path (str): Path to the resume file
Returns:
dict: Dictionary containing extracted features from resume
"""
try:
data = ResumeParser(resume_path).get_extracted_data()
return data
except Exception as e:
print(f"Error parsing resume: {e}")
return {
'name': '',
'email': '',
'mobile_number': '',
'skills': [],
'experience': [],
'no_of_pages': 0,
'total_experience': 0
}
# Example usage (will run if script is executed directly)
if __name__ == "__main__":
# Build absolute path to the resume file
current_dir = os.path.dirname(os.path.abspath(__file__))
resume_path = os.path.join(current_dir, '../../../data/resumes/Hussein El Saadi - CV.pdf')
# Parse and print the extracted data
data = extract_resume_features(resume_path)
print(data) |