Skip to content

Commit 69a2218

Browse files
Merge pull request #18 from Riminder/feature/expose-hrflow-schemas
Feature/expose hrflow schemas
2 parents 9d00b5c + 461d83d commit 69a2218

9 files changed

Lines changed: 483 additions & 230 deletions

File tree

hrflow/hrflow/schemas.py

Lines changed: 355 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,355 @@
1+
import typing as t
2+
3+
from pydantic import BaseModel, Field
4+
5+
6+
class LocationFields(BaseModel):
7+
category: t.Optional[str]
8+
city: t.Optional[str]
9+
city_district: t.Optional[str]
10+
country: t.Optional[str]
11+
country_region: t.Optional[str]
12+
entrance: t.Optional[str]
13+
house: t.Optional[str]
14+
house_number: t.Optional[str]
15+
island: t.Optional[str]
16+
level: t.Optional[str]
17+
near: t.Optional[str]
18+
po_box: t.Optional[str]
19+
postcode: t.Optional[str]
20+
road: t.Optional[str]
21+
staircase: t.Optional[str]
22+
state: t.Optional[str]
23+
state_district: t.Optional[str]
24+
suburb: t.Optional[str]
25+
text: t.Optional[str]
26+
unit: t.Optional[str]
27+
world_region: t.Optional[str]
28+
29+
30+
class Location(BaseModel):
31+
text: t.Optional[str] = Field(None, description="Location text address.")
32+
lat: t.Optional[float] = Field(
33+
None, description="Geocentric latitude of the Location."
34+
)
35+
lng: t.Optional[float] = Field(
36+
None, description="Geocentric longitude of the Location."
37+
)
38+
_fields: t.Optional[LocationFields] = Field(
39+
None,
40+
alias="fields",
41+
description="Other location attributes like country, country_code etc",
42+
)
43+
44+
45+
class GeneralEntitySchema(BaseModel):
46+
name: str = Field(..., description="Identification name of the Object")
47+
value: t.Optional[str] = Field(
48+
None, description="Value associated to the Object's name"
49+
)
50+
51+
52+
class Skill(BaseModel):
53+
name: str = Field(..., description="Identification name of the skill")
54+
type: t.Optional[str] = Field(None, description="Type of the skill. hard or soft")
55+
value: t.Optional[str] = Field(None, description="Value associated to the skill")
56+
57+
58+
# Job
59+
class Section(BaseModel):
60+
name: t.Optional[str] = Field(
61+
None,
62+
description="Identification name of a Section of the Job. Example: culture",
63+
)
64+
title: t.Optional[str] = Field(
65+
None, description="Display Title of a Section. Example: Corporate Culture"
66+
)
67+
description: t.Optional[str] = Field(
68+
None, description="Text description of a Section: Example: Our values areNone"
69+
)
70+
71+
72+
class RangesFloat(BaseModel):
73+
name: t.Optional[str] = Field(
74+
None,
75+
description=(
76+
"Identification name of a Range of floats attached "
77+
"to the Job. Example: salary"
78+
),
79+
)
80+
value_min: t.Optional[float] = Field(None, description="Min value. Example: 500.")
81+
value_max: t.Optional[float] = Field(None, description="Max value. Example: 100.")
82+
unit: t.Optional[str] = Field(
83+
None, description="Unit of the value. Example: euros."
84+
)
85+
86+
87+
class RangesDate(BaseModel):
88+
name: t.Optional[str] = Field(
89+
None,
90+
description=(
91+
"Identification name of a Range of dates attached"
92+
" to the Job. Example: availability."
93+
),
94+
)
95+
value_min: t.Optional[str] = Field(
96+
None, description="Min value in datetime ISO 8601, Example: 500."
97+
)
98+
value_max: t.Optional[str] = Field(
99+
None, description="Max value in datetime ISO 8601, Example: 1000"
100+
)
101+
102+
103+
class Board(BaseModel):
104+
key: str = Field(..., description="Identification key of the Board.")
105+
name: str = Field(..., description="Name of the Board.")
106+
type: str = Field(..., description="Type of the Board, Example: api, folder")
107+
subtype: str = Field(
108+
..., description="Subtype of the Board, Example: python, excel"
109+
)
110+
environment: str = Field(
111+
..., description="Environment of the Board, Example: production, staging, test"
112+
)
113+
114+
115+
class HrFlowJob(BaseModel):
116+
key: str = Field(None, description="Identification key of the Job.")
117+
reference: t.Optional[str] = Field(
118+
None, description="Custom identifier of the Job."
119+
)
120+
name: str = Field(..., description="Job title.")
121+
board_key: str = Field(
122+
..., description="Identification key of the Board attached to the Job."
123+
)
124+
location: Location = Field(..., description="Job location object.")
125+
sections: t.List[Section] = Field(None, description="Job custom sections.")
126+
culture: t.Optional[str] = Field(
127+
None, description="Describes the company's values, work environment, and ethos."
128+
)
129+
benefits: t.Optional[str] = Field(
130+
None, description="Lists the perks and advantages offered to employees."
131+
)
132+
responsibilities: t.Optional[str] = Field(
133+
None, description="Outlines the duties and tasks expected from the role."
134+
)
135+
requirements: t.Optional[str] = Field(
136+
None,
137+
description="Specifies the qualifications and skills needed for the position.",
138+
)
139+
interviews: t.Optional[str] = Field(
140+
None, description="Provides information about the interview process and stages."
141+
)
142+
url: t.Optional[str] = Field(None, description="Job post original URL.")
143+
summary: t.Optional[str] = Field(None, description="Brief summary of the Job.")
144+
board: t.Optional[Board]
145+
archived_at: t.Optional[str] = Field(
146+
None,
147+
description=(
148+
"type: datetime ISO8601, Archive date of the Job. "
149+
"The value is null for unarchived Jobs."
150+
),
151+
)
152+
updated_at: str = Field(
153+
None, description="type: datetime ISO8601, Last update date of the Job."
154+
)
155+
created_at: t.Optional[str] = Field(
156+
None, description="type: datetime ISO8601, Creation date of the Job."
157+
)
158+
skills: t.Optional[t.List[Skill]] = Field(
159+
None, description="List of skills of the Job."
160+
)
161+
languages: t.Optional[t.List[GeneralEntitySchema]] = Field(
162+
None, description="List of spoken languages of the Job"
163+
)
164+
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
165+
None, description="List of certifications of the Job."
166+
)
167+
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
168+
None, description="List of courses of the Job"
169+
)
170+
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
171+
None, description="List of tasks of the Job"
172+
)
173+
tags: t.Optional[t.List[GeneralEntitySchema]] = Field(
174+
None, description="List of tags of the Job"
175+
)
176+
metadatas: t.Optional[t.List[GeneralEntitySchema]] = Field(
177+
None, description="List of metadatas of the Job"
178+
)
179+
ranges_float: t.Optional[t.List[RangesFloat]] = Field(
180+
None, description="List of ranges of floats"
181+
)
182+
ranges_date: t.Optional[t.List[RangesDate]] = Field(
183+
None, description="List of ranges of dates"
184+
)
185+
186+
187+
# Profile
188+
class Url(BaseModel):
189+
type: t.Optional[
190+
t.Literal["from_resume", "linkedin", "twitter", "facebook", "github"]
191+
]
192+
url: t.Optional[str]
193+
194+
195+
class ProfileInfo(BaseModel):
196+
full_name: t.Optional[str] = Field(None, description="Profile full name")
197+
first_name: t.Optional[str] = Field(None, description="Profile first name")
198+
last_name: t.Optional[str] = Field(None, description="Profile last name")
199+
email: t.Optional[str] = Field(None, description="Profile email")
200+
phone: t.Optional[str] = Field(None, description="Profile phone number")
201+
date_birth: t.Optional[str] = Field(None, description="Profile date of birth")
202+
location: t.Optional[Location] = Field(None, description="Profile location object")
203+
urls: t.Optional[t.List[Url]] = Field(
204+
None, description="Profile social networks and URLs"
205+
)
206+
picture: t.Optional[str] = Field(None, description="Profile picture url")
207+
gender: t.Optional[str] = Field(None, description="Profile gender")
208+
summary: t.Optional[str] = Field(None, description="Profile summary text")
209+
210+
211+
class Experience(BaseModel):
212+
key: t.Optional[str] = Field(
213+
None, description="Identification key of the Experience."
214+
)
215+
company: t.Optional[str] = Field(
216+
None, description="Company name of the Experience."
217+
)
218+
logo: t.Optional[str] = Field(None, description="Logo of the Company.")
219+
title: t.Optional[str] = Field(None, description="Title of the Experience.")
220+
description: t.Optional[str] = Field(
221+
None, description="Description of the Experience."
222+
)
223+
location: t.Optional[Location] = Field(
224+
None, description="Location object of the Experience."
225+
)
226+
date_start: t.Optional[str] = Field(
227+
None, description="Start date of the experience. type: ('datetime ISO 8601')"
228+
)
229+
date_end: t.Optional[str] = Field(
230+
None, description="End date of the experience. type: ('datetime ISO 8601')"
231+
)
232+
skills: t.Optional[t.List[Skill]] = Field(
233+
None, description="List of skills of the Experience."
234+
)
235+
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
236+
None, description="List of certifications of the Experience."
237+
)
238+
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
239+
None, description="List of courses of the Experience."
240+
)
241+
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
242+
None, description="List of tasks of the Experience."
243+
)
244+
245+
246+
class Education(BaseModel):
247+
key: t.Optional[str] = Field(
248+
None, description="Identification key of the Education."
249+
)
250+
school: t.Optional[str] = Field(None, description="School name of the Education.")
251+
logo: t.Optional[str] = Field(None, description="Logo of the School.")
252+
title: t.Optional[str] = Field(None, description="Title of the Education.")
253+
description: t.Optional[str] = Field(
254+
None, description="Description of the Education."
255+
)
256+
location: t.Optional[Location] = Field(
257+
None, description="Location object of the Education."
258+
)
259+
date_start: t.Optional[str] = Field(
260+
None, description="Start date of the Education. type: ('datetime ISO 8601')"
261+
)
262+
date_end: t.Optional[str] = Field(
263+
None, description="End date of the Education. type: ('datetime ISO 8601')"
264+
)
265+
skills: t.Optional[t.List[Skill]] = Field(
266+
None, description="List of skills of the Education."
267+
)
268+
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
269+
None, description="List of certifications of the Education."
270+
)
271+
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
272+
None, description="List of courses of the Education."
273+
)
274+
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
275+
None, description="List of tasks of the Education."
276+
)
277+
278+
279+
class Attachment(BaseModel):
280+
type: t.Optional[str]
281+
alt: t.Optional[str]
282+
file_size: t.Optional[str]
283+
file_name: t.Optional[str]
284+
original_file_name: t.Optional[str]
285+
extension: t.Optional[str]
286+
public_url: t.Optional[str]
287+
updated_at: t.Optional[str]
288+
created_at: t.Optional[str]
289+
290+
291+
class HrFlowProfile(BaseModel):
292+
key: str = Field(None, description="Identification key of the Profile.")
293+
reference: t.Optional[str] = Field(
294+
None, description="Custom identifier of the Profile."
295+
)
296+
info: ProfileInfo = Field(..., description="Object containing the Profile's info.")
297+
text_language: str = Field(
298+
..., description="Code language of the Profile. type: string code ISO 639-1"
299+
)
300+
text: str = Field(..., description="Full text of the Profile..")
301+
archived_at: t.Optional[str] = Field(
302+
None,
303+
description=(
304+
"type: datetime ISO8601, Archive date of the Profile."
305+
" The value is null for unarchived Profiles."
306+
),
307+
)
308+
updated_at: str = Field(
309+
None, description="type: datetime ISO8601, Last update date of the Profile."
310+
)
311+
created_at: str = Field(
312+
None, description="type: datetime ISO8601, Creation date of the Profile."
313+
)
314+
experiences_duration: float = Field(
315+
None, description="Total number of years of experience."
316+
)
317+
educations_duration: float = Field(
318+
None, description="Total number of years of education."
319+
)
320+
experiences: t.Optional[t.List[Experience]] = Field(
321+
None, description="List of experiences of the Profile."
322+
)
323+
educations: t.Optional[t.List[Education]] = Field(
324+
None, description="List of educations of the Profile."
325+
)
326+
attachments: t.List[Attachment] = Field(
327+
None, description="List of documents attached to the Profile."
328+
)
329+
skills: t.Optional[t.List[Skill]] = Field(
330+
None, description="List of skills of the Profile."
331+
)
332+
languages: t.Optional[t.List[GeneralEntitySchema]] = Field(
333+
None, description="List of spoken languages of the profile"
334+
)
335+
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
336+
None, description="List of certifications of the Profile."
337+
)
338+
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
339+
None, description="List of courses of the Profile."
340+
)
341+
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
342+
None, description="List of tasks of the Profile."
343+
)
344+
interests: t.Optional[t.List[GeneralEntitySchema]] = Field(
345+
None, description="List of interests of the Profile."
346+
)
347+
tags: t.Optional[t.List[GeneralEntitySchema]] = Field(
348+
None, description="List of tags of the Profile."
349+
)
350+
metadatas: t.Optional[t.List[GeneralEntitySchema]] = Field(
351+
None, description="List of metadatas of the Profile."
352+
)
353+
labels: t.Optional[t.List[GeneralEntitySchema]] = Field(
354+
None, description="List of labels of the Profile."
355+
)

0 commit comments

Comments
 (0)