Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support linkedin url for extracting information #44

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Features
- Extract degree
- Extract designation
- Extract company names
- Extract linkedin url

Installation
============
Expand Down
3 changes: 3 additions & 0 deletions pyresparser/resume_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __get_basic_details(self):
self.__noun_chunks,
self.__skills_file
)
linkedin = utils.extract_linkedin(self.__text)
# edu = utils.extract_education(
# [sent.string.strip() for sent in self.__nlp.sents]
# )
Expand Down Expand Up @@ -121,6 +122,8 @@ def __get_basic_details(self):
self.__details['no_of_pages'] = utils.get_number_of_pages(
self.__resume
)

self.__details['linkedin'] = linkedin
return


Expand Down
14 changes: 14 additions & 0 deletions pyresparser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,17 @@ def extract_experience(resume_text):
if x and 'experience' in x.lower()
]
return x


def extract_linkedin(text):
'''
Helper function to extract linkedin from text

:param text: plain text extracted from resume file
'''
linkedin = re.findall(r'([\s]+linkedin.com[^\s]+)', text)
if linkedin:
try:
return linkedin[0][0]
except IndexError:
return None
5 changes: 5 additions & 0 deletions test_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ def test_local_name():
def test_local_phone_number():
data = get_local_data()
assert '8087996634' == data['mobile_number']

def test_linkedin_url():
data = get_remote_data()
# no valid linkedin url yet
assert None == data[0]['linkedin']