Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ media
pyrightconfig.json

*.env*
pyvenv.cfg
5 changes: 5 additions & 0 deletions edenai_apis/api_keys/hirize_settings_template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"api_key": ""
}
]
Empty file.
42 changes: 42 additions & 0 deletions edenai_apis/apis/hirize/hirize_api.py
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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]:

dumpData = json.dumps({
"payload": payload,
"file_name": file_name
})

hirize_response = requests.request("POST", self.url, headers=self.headers, data=dumpData)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There needs to be some error handling here, raising ProviderException. Problably also best to create a client.py, where the client requests are handled


return ResponseType[ResumeParserDataClass](
original_response=hirize_response.json()
)
17 changes: 17 additions & 0 deletions edenai_apis/apis/hirize/info.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"
}
}
}
}
}
70 changes: 70 additions & 0 deletions edenai_apis/apis/hirize/outputs/parser/resume_parser_output.json
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
}
]
}
}
}
4 changes: 4 additions & 0 deletions edenai_apis/apis/hirize/tests/params.py

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions edenai_apis/apis/hirize/tests/test.py
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:
@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