Skip to content

Commit d8322f9

Browse files
authored
Merge pull request #21 from magicalapi/update-matcher
Update Resume matcher
2 parents 103c391 + ff84b40 commit d8322f9

20 files changed

Lines changed: 1047 additions & 535 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ It offers services like:
8181

8282
## Supported APIs
8383
- Resume Parser
84-
- Resume Checker
85-
- Resume Matcher
84+
- Resume Checker(Review)
85+
- Resume Matcher(Score)
8686
- LinkedIn Profile Scraper
8787
- LinkedIn Company Scraper
8888

examples/resume_score.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
resume_url = (
88
"https://resume-resource.com/wp-content/uploads/00123-sales-professional-resume.pdf"
99
)
10-
job_description = "Sales Professional"
10+
job_description = (
11+
"We are hiring a sales professional with proven B2B pipeline management, "
12+
"CRM discipline, account growth ownership, and strong written communication."
13+
)
1114
output_file_name = "resume_score.json"
1215

1316

magicalapi/services/company_data_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
this file stores the implementation of company data Service.
2+
this file stores the implementation of LinkedIn Company Scraper Service.
33
https://magicalapi.com/services/company-data
44
55
"""
@@ -24,7 +24,7 @@ async def get_company_data(
2424
company_name: str | None = None,
2525
company_website: str | None = None,
2626
) -> CompanyDataResponse | WebhookCreatedResponse | ErrorResponse:
27-
"""this method sends request to company data service in magicalAPI.
27+
"""this method sends request to LinkedIn Company Scraper service in magicalAPI.
2828
https://magicalapi.com/services/company-data
2929
3030
company_name (``str``):

magicalapi/services/profile_data_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
this file stores the implementation of profile data Service.
2+
this file stores the implementation of LinkedIn Profile Scraper Service.
33
https://magicalapi.com/services/profile-data
44
55
"""
@@ -21,7 +21,7 @@ class ProfileDataService(BaseService):
2121
async def get_profile_data(
2222
self, profile_name: str
2323
) -> ProfileDataResponse | WebhookCreatedResponse | ErrorResponse:
24-
"""this method sends request to profile data service in magicalAPI.
24+
"""this method sends request to LinkedIn Profile Scraper service in magicalAPI.
2525
https://magicalapi.com/services/profile-data
2626
2727
profile_name (``str``):
@@ -49,4 +49,4 @@ async def get_profile_data(
4949
def validate_response(
5050
self, response: HttpResponse, validate_model: type[BaseModel]
5151
) -> ProfileDataResponse | WebhookCreatedResponse | ErrorResponse:
52-
return super().validate_response(response, validate_model) # type:ignore
52+
return super().validate_response(response, validate_model) # type: ignore

magicalapi/services/resume_review_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
this file stores the implementation of resume review Service.
2+
this file stores the implementation of Resume Checker(Review) Service.
33
https://magicalapi.com/services/resume-review
44
55
"""
@@ -19,7 +19,7 @@ class ResumeReviewService(BaseService):
1919
async def get_resume_review(
2020
self, url: str
2121
) -> ResumeReviewResponse | WebhookCreatedResponse | ErrorResponse:
22-
"""this method sends request to resume review service in magicalAPI.
22+
"""this method sends request to Resume Checker(Review) service in magicalAPI.
2323
https://magicalapi.com/services/resume-review
2424
2525
url (``str``):

magicalapi/services/resume_score_service.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
this file stores the implementation of resume score Service.
2+
this file stores the implementation of Resume Matcher(Score) Service.
33
https://magicalapi.com/services/resume-score
44
55
"""
@@ -19,7 +19,7 @@ class ResumeScoreService(BaseService):
1919
async def get_resume_score(
2020
self, url: str, job_description: str
2121
) -> ResumeScoreResponse | WebhookCreatedResponse | ErrorResponse:
22-
"""this method sends request to resume score service in magicalAPI.
22+
"""this method sends request to Resume Matcher(Score) service in magicalAPI.
2323
https://magicalapi.com/services/resume-score
2424
2525
url (``str``):
@@ -28,13 +28,22 @@ async def get_resume_score(
2828
job_description (``str``):
2929
give some description of the job,
3030
your resume score will calculate based on your job description.
31+
must be between 100 and 5000 characters long.
3132
3233
Returns:
3334
ResumeScoreResponse: When request completes successfully (no webhook).
3435
WebhookCreatedResponse: When using webhook_url (immediate acknowledgment).
3536
ErrorResponse: When an error occurs (e.g., 403 if webhook domain not whitelisted).
3637
38+
Raises:
39+
ValueError: If job_description is not between 100 and 5000 characters long.
40+
3741
"""
42+
if not 100 <= len(job_description) <= 5000:
43+
raise ValueError(
44+
"job_description must be between 100 and 5000 characters long"
45+
)
46+
3847
request_body = {
3948
"url": url,
4049
"job_description": job_description,

magicalapi/types/company_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Funding(BaseModelValidated):
6464

6565
class Company(BaseModelValidated):
6666
"""
67-
The main type of company data service
67+
The main type of LinkedIn Company Scraper service
6868
"""
6969

7070
url: str

magicalapi/types/profile_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class Patent(BaseModelValidated):
151151

152152
class Profile(BaseModelValidated):
153153
"""
154-
The main type of linkedin profile data service
154+
The main type of LinkedIn Profile Scraper service
155155
"""
156156

157157
url: str

magicalapi/types/resume_review.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
types schem of resume review service
2+
types schema of Resume Checker(Review) service
33
44
"""
55

magicalapi/types/resume_score.py

Lines changed: 85 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,102 @@
11
"""
2-
types schem of resume score service
2+
types schema of Resume Matcher(Score) service
33
https://magicalapi.com/services/resume-score
44
"""
55

66
from __future__ import annotations
77

8+
from typing import Literal
9+
810
from .base import BaseModelValidated, BaseResponse
911

12+
Category = Literal[
13+
"job",
14+
"education",
15+
"skills",
16+
"other",
17+
]
18+
19+
20+
class StrengthItem(BaseModelValidated):
21+
text: str | None
22+
category: Category
23+
24+
25+
class ImprovementItem(BaseModelValidated):
26+
text: str | None
27+
category: Category
28+
29+
30+
class ProsSchema(BaseModelValidated):
31+
type: str | None
32+
message: str | None
33+
34+
35+
class ConsSchema(BaseModelValidated):
36+
type: str | None
37+
message: str | None
38+
39+
40+
class WarnSchema(BaseModelValidated):
41+
type: str | None
42+
message: str | None
43+
44+
45+
class JobMatchResponse(BaseModelValidated):
46+
score: int
47+
summary: str | None
48+
pros: list[ProsSchema]
49+
cons: list[ConsSchema]
50+
warns: list[WarnSchema]
51+
52+
53+
class SkillGroups(BaseModelValidated):
54+
all_skills: list[str]
55+
56+
57+
class SkillMatch(BaseModelValidated):
58+
miss_match: list[str]
59+
partial_match: list[str]
60+
strong_match: list[str]
61+
62+
63+
class SkillMatchResponse(BaseModelValidated):
64+
score: int
65+
summary: str | None
66+
skills: SkillGroups
67+
match_result: SkillMatch
68+
69+
70+
class EducationMatchResponse(BaseModelValidated):
71+
score: int
72+
summary: str | None
73+
pros: list[ProsSchema]
74+
cons: list[ConsSchema]
75+
warns: list[WarnSchema]
76+
77+
78+
class MoreInformationResponse(BaseModelValidated):
79+
region: str | None
80+
overqualification_status: bool
81+
qualification_reason: str | None
82+
1083

11-
class ResumeScore(BaseModelValidated):
84+
class ScoreResponse(BaseModelValidated):
1285
score: int
13-
reason: str
86+
summary: str
87+
strengths: list[StrengthItem]
88+
improvements: list[ImprovementItem]
89+
job_match: JobMatchResponse
90+
skill_match: SkillMatchResponse
91+
education_match: EducationMatchResponse
92+
more_information: MoreInformationResponse
93+
jd_text: str | None
1494

1595

1696
class ResumeScoreResponse(BaseResponse):
1797
"""
18-
the main resposne schema for resume score service
98+
the main response schema for Resume Matcher(Score) service
1999
https://magicalapi.com/services/resume-score
20100
"""
21101

22-
data: ResumeScore
102+
data: ScoreResponse

0 commit comments

Comments
 (0)