-
Notifications
You must be signed in to change notification settings - Fork 70
Hirize #160
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
base: master
Are you sure you want to change the base?
Hirize #160
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,3 +27,4 @@ media | |
| pyrightconfig.json | ||
|
|
||
| *.env* | ||
| pyvenv.cfg | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [ | ||
| { | ||
| "api_key": "" | ||
| } | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| from edenai_apis.features.provider.provider_interface import ProviderInterface | ||
| from typing import Dict | ||
| from edenai_apis.loaders.data_loader import ProviderDataEnum | ||
| from edenai_apis.loaders.loaders import load_provider | ||
| from edenai_apis.utils.types import ResponseType | ||
| from edenai_apis.features.ocr.resume_parser.resume_parser_dataclass import ResumeParserDataClass | ||
| import random | ||
| import requests | ||
| import json | ||
| from .client import Client | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. client doesnt exist |
||
|
|
||
| class HirizeApi(ProviderInterface): | ||
|
|
||
| provider_name: str = "hirize" | ||
| def __init__(self, api_keys: Dict = {}): | ||
| self.api_settings = load_provider( | ||
| ProviderDataEnum.KEY, self.provider_name, api_keys=api_keys | ||
| ) | ||
|
|
||
| if isinstance(self.api_settings, list): | ||
| chosen_api_setting = random.choice(self.api_settings) | ||
| else: | ||
| chosen_api_setting = self.api_settings | ||
|
|
||
| self.api_key = chosen_api_setting["api_key"] | ||
| self.url = "https://connect.hirize.hr/api/public/?api_key=" + self.api_key | ||
| self.headers = { | ||
| 'Content-Type': 'application/json' | ||
| } | ||
|
|
||
| def resume_parser(self, payload: str, file_name: str) -> ResponseType[ResumeParserDataClass]: | ||
sefasaylan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| dumpData = json.dumps({ | ||
| "payload": payload, | ||
| "file_name": file_name | ||
| }) | ||
|
|
||
| hirize_response = requests.request("POST", self.url, headers=self.headers, data=dumpData) | ||
|
||
|
|
||
| return ResponseType[ResumeParserDataClass]( | ||
| original_response=hirize_response.json() | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "text": { | ||
| "resume_parser": { | ||
| "version": "v1.0", | ||
| "constraints": { | ||
| "payload": { | ||
| "presence": true, | ||
| "type": "string" | ||
| }, | ||
| "file_name": { | ||
| "presence": true, | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| { | ||
| "success": true, | ||
| "remaining_credit": 8.12, | ||
| "data": { | ||
| "id": 22978, | ||
| "result": { | ||
| "skills": [ | ||
| "Detail Oriented", | ||
| "Graphic Design", | ||
| "Aesthetics", | ||
| "Product Design", | ||
| "Moz (SEO Software)", | ||
| "Website Management", | ||
| "Content Design", | ||
| "Brand Marketing", | ||
| "Industrial Production", | ||
| "Logo Design", | ||
| "Branding", | ||
| "Team Management", | ||
| "Digital Marketing", | ||
| "Copywriting", | ||
| "English Language", | ||
| "French Language" | ||
| ], | ||
| "basic_info": { | ||
| "name": "Olivia Wilson", | ||
| "links": [ | ||
| "www.reallygreatsite.com" | ||
| ], | ||
| "current_position": "Product Design Manager" | ||
| }, | ||
| "contact_info": { | ||
| "email": "hello@reallygreatsite.com", | ||
| "phone_number": "+123-456-7890", | ||
| "street_address": "123 Anywhere St.", | ||
| "city": "Any", | ||
| "zip_code": "12345", | ||
| "country": "Any" | ||
| }, | ||
| "work_experience": { | ||
| "works": [ | ||
| { | ||
| "company": "Ginyard International Co.", | ||
| "end_date": "2023-01-01", | ||
| "job_title": "Product Design Manager", | ||
| "seniority": "Mid", | ||
| "start_date": "2020-01-01", | ||
| "months": 36 | ||
| } | ||
| ], | ||
| "total_work_experience": 3, | ||
| "average_time": 3 | ||
| }, | ||
| "education": [ | ||
| { | ||
| "major": "Product Design", | ||
| "school_name": "Arowwai Industries", | ||
| "education_level": "Bachelor of Design", | ||
| "graduation_year": 2019 | ||
| }, | ||
| { | ||
| "major": "Branding and Logo Design", | ||
| "school_name": "Wardiere University", | ||
| "education_level": "Bachelor of Design", | ||
| "graduation_year": 2008 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import base64 | ||
| import json | ||
|
|
||
| import pytest | ||
| import requests | ||
| import params | ||
| class TestVisitURLForm: | ||
sefasaylan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| @pytest.fixture(scope="class") | ||
|
|
||
| def test(self): | ||
|
|
||
| assert True | ||
| def test_submit_form_with_base64_pdf(self, test): | ||
|
|
||
| self.api_key = params.hirize_api_key | ||
| self.url = "https://connect.hirize.hr/api/public/parser?api_key=" + self.api_key | ||
| self.headers = { | ||
| 'Content-Type': 'application/json' | ||
| } | ||
| dumpData = json.dumps({ | ||
| "payload": params.file_payload, | ||
| "file_name": params.file_name | ||
| }) | ||
|
|
||
| hirize_response = requests.request("POST", self.url, headers=self.headers, data=dumpData) | ||
|
|
||
| assert hirize_response.status_code == 201 | ||
Uh oh!
There was an error while loading. Please reload this page.