brynq-sdk-recruitee 3.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brynq_sdk_recruitee/__init__.py +66 -0
- brynq_sdk_recruitee/applicants.py +74 -0
- brynq_sdk_recruitee/candidates.py +123 -0
- brynq_sdk_recruitee/offers.py +191 -0
- brynq_sdk_recruitee/organization.py +86 -0
- brynq_sdk_recruitee/recruitee.py +100 -0
- brynq_sdk_recruitee/vacancies.py +89 -0
- brynq_sdk_recruitee-3.0.1.dist-info/METADATA +17 -0
- brynq_sdk_recruitee-3.0.1.dist-info/RECORD +11 -0
- brynq_sdk_recruitee-3.0.1.dist-info/WHEEL +5 -0
- brynq_sdk_recruitee-3.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Recruitee SDK for Python
|
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
A Python SDK for interacting with the Recruitee API.
|
|
6
|
+
|
|
7
|
+
This SDK provides a clean, modular interface to the Recruitee API with specialized
|
|
8
|
+
modules for different aspects of the API (candidates, offers, organization, etc.).
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from typing import Dict, Any
|
|
12
|
+
import requests
|
|
13
|
+
from .recruitee import Recruitee
|
|
14
|
+
from .candidates import Candidates
|
|
15
|
+
from .offers import Offers
|
|
16
|
+
from .organization import Organization
|
|
17
|
+
from .vacancies import Vacancies
|
|
18
|
+
from .applicants import Applicants
|
|
19
|
+
|
|
20
|
+
__version__ = '1.0.0'
|
|
21
|
+
__author__ = 'BrynQ'
|
|
22
|
+
__license__ = 'BrynQ License'
|
|
23
|
+
|
|
24
|
+
class RecruiteeError(Exception):
|
|
25
|
+
"""Base exception for Recruitee SDK errors."""
|
|
26
|
+
pass
|
|
27
|
+
|
|
28
|
+
class RecruiteeAuthError(RecruiteeError):
|
|
29
|
+
"""Raised when there are authentication issues."""
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
class RecruiteeConfigError(RecruiteeError):
|
|
33
|
+
"""Raised when there are configuration issues."""
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
def validate_credentials(credentials: Dict[str, Any]) -> None:
|
|
37
|
+
"""
|
|
38
|
+
Validate the credentials dictionary has required fields.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
credentials: Dictionary containing credentials
|
|
42
|
+
|
|
43
|
+
Raises:
|
|
44
|
+
RecruiteeConfigError: If required credentials are missing
|
|
45
|
+
"""
|
|
46
|
+
required_fields = ['company_id', 'token']
|
|
47
|
+
missing_fields = [field for field in required_fields if field not in credentials]
|
|
48
|
+
|
|
49
|
+
if missing_fields:
|
|
50
|
+
raise RecruiteeConfigError(
|
|
51
|
+
f"Missing required credentials: {', '.join(missing_fields)}"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Export all classes
|
|
55
|
+
__all__ = [
|
|
56
|
+
'Recruitee',
|
|
57
|
+
'Candidates',
|
|
58
|
+
'Offers',
|
|
59
|
+
'Organization',
|
|
60
|
+
'Vacancies',
|
|
61
|
+
'Applicants',
|
|
62
|
+
'RecruiteeError',
|
|
63
|
+
'RecruiteeAuthError',
|
|
64
|
+
'RecruiteeConfigError',
|
|
65
|
+
'validate_credentials'
|
|
66
|
+
]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Applicants API module for Recruitee.
|
|
3
|
+
"""
|
|
4
|
+
from typing import Dict, Optional, List, Union
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Applicants:
|
|
9
|
+
"""
|
|
10
|
+
Class for interacting with Recruitee applicants API.
|
|
11
|
+
|
|
12
|
+
This class provides methods for creating, updating, and managing applicants in Recruitee.
|
|
13
|
+
"""
|
|
14
|
+
def __init__(self, recruitee_client):
|
|
15
|
+
"""
|
|
16
|
+
Initialize the Applicants API client.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
recruitee_client: An instance of the Recruitee client
|
|
20
|
+
"""
|
|
21
|
+
self.client = recruitee_client
|
|
22
|
+
|
|
23
|
+
def get_applicants(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
24
|
+
"""
|
|
25
|
+
Get all applicants from Recruitee.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
filters: Optional filters to apply
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Response from the API
|
|
32
|
+
"""
|
|
33
|
+
return self.client.get_candidates(filters=filters)
|
|
34
|
+
|
|
35
|
+
def get_applicant(self, candidate_id: str) -> requests.Response:
|
|
36
|
+
"""
|
|
37
|
+
Get a specific applicant from Recruitee.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
candidate_id: The ID of the candidate
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
Response from the API
|
|
44
|
+
"""
|
|
45
|
+
return self.client.get_candidate(candidate_id=candidate_id)
|
|
46
|
+
|
|
47
|
+
def update_applicant_tags(self, candidate_ids: List[str], tags: List[str]) -> requests.Response:
|
|
48
|
+
"""
|
|
49
|
+
Update tags for multiple applicants.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
candidate_ids: List of candidate IDs
|
|
53
|
+
tags: List of tags to add
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
Response from the API
|
|
57
|
+
"""
|
|
58
|
+
data = {
|
|
59
|
+
"candidates": candidate_ids,
|
|
60
|
+
"tags": tags
|
|
61
|
+
}
|
|
62
|
+
return self.client.patch_bulk_candidates_tags(data=data)
|
|
63
|
+
|
|
64
|
+
def get_applicant_mailbox(self, candidate_id: str) -> requests.Response:
|
|
65
|
+
"""
|
|
66
|
+
Get the mailbox for a specific applicant.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
candidate_id: The ID of the candidate
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Response from the API
|
|
73
|
+
"""
|
|
74
|
+
return self.client.get_mailbox(candidate_id=candidate_id)
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Candidates API module for Recruitee.
|
|
3
|
+
"""
|
|
4
|
+
from typing import Dict, Optional, List, Union
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Candidates:
|
|
9
|
+
"""
|
|
10
|
+
Class for interacting with Recruitee candidates API.
|
|
11
|
+
|
|
12
|
+
This class provides methods for managing candidates in Recruitee.
|
|
13
|
+
"""
|
|
14
|
+
def __init__(self, recruitee_client):
|
|
15
|
+
"""
|
|
16
|
+
Initialize the Candidates API client.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
recruitee_client: An instance of the Recruitee client
|
|
20
|
+
"""
|
|
21
|
+
self.client = recruitee_client
|
|
22
|
+
|
|
23
|
+
def get_candidates(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
24
|
+
"""
|
|
25
|
+
Get all candidates from Recruitee.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
filters: Optional filters to apply
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Response from the API
|
|
32
|
+
"""
|
|
33
|
+
return self.client.get(
|
|
34
|
+
endpoint="candidates",
|
|
35
|
+
params=filters
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def get_candidate(self, candidate_id: str) -> requests.Response:
|
|
39
|
+
"""
|
|
40
|
+
Get a specific candidate from Recruitee.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
candidate_id: The ID of the candidate
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
Response from the API
|
|
47
|
+
"""
|
|
48
|
+
return self.client.get(
|
|
49
|
+
endpoint=f"candidates/{candidate_id}"
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def get_candidate_details(self, candidate_id: str) -> requests.Response:
|
|
53
|
+
"""
|
|
54
|
+
Get detailed information about a specific candidate from Recruitee.
|
|
55
|
+
This is an alias for get_candidate for backward compatibility.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
candidate_id: The ID of the candidate
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
Response from the API
|
|
62
|
+
"""
|
|
63
|
+
return self.get_candidate(candidate_id)
|
|
64
|
+
|
|
65
|
+
def patch_bulk_candidates_tags(self, data: Dict) -> requests.Response:
|
|
66
|
+
"""
|
|
67
|
+
Update tags for multiple candidates.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
data: Dictionary containing candidates and tags
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
Response from the API
|
|
74
|
+
"""
|
|
75
|
+
return self.client.patch(
|
|
76
|
+
endpoint="bulk/candidates/tags",
|
|
77
|
+
json=data
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def update_candidate_tags(self, candidate_ids: List[str], tags: List[str]) -> requests.Response:
|
|
81
|
+
"""
|
|
82
|
+
Update tags for multiple candidates.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
candidate_ids: List of candidate IDs
|
|
86
|
+
tags: List of tags to add
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
Response from the API
|
|
90
|
+
"""
|
|
91
|
+
data = {
|
|
92
|
+
"candidates": candidate_ids,
|
|
93
|
+
"tags": tags
|
|
94
|
+
}
|
|
95
|
+
return self.patch_bulk_candidates_tags(data)
|
|
96
|
+
|
|
97
|
+
def update_rehire_tags(self, candidate_ids: List[str], tags: List[str]) -> requests.Response:
|
|
98
|
+
"""
|
|
99
|
+
Update rehire-related tags for multiple candidates.
|
|
100
|
+
This is an alias for update_candidate_tags for backward compatibility.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
candidate_ids: List of candidate IDs
|
|
104
|
+
tags: List of tags to add
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Response from the API
|
|
108
|
+
"""
|
|
109
|
+
return self.update_candidate_tags(candidate_ids, tags)
|
|
110
|
+
|
|
111
|
+
def get_mailbox(self, candidate_id: str) -> requests.Response:
|
|
112
|
+
"""
|
|
113
|
+
Get the mailbox for a specific candidate.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
candidate_id: The ID of the candidate
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
Response from the API
|
|
120
|
+
"""
|
|
121
|
+
return self.client.get(
|
|
122
|
+
endpoint=f"mailbox/candidate/{candidate_id}"
|
|
123
|
+
)
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Offers API module for Recruitee.
|
|
3
|
+
"""
|
|
4
|
+
from typing import Dict, Optional, List, Union
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Offers:
|
|
9
|
+
"""
|
|
10
|
+
Class for interacting with Recruitee offers API.
|
|
11
|
+
|
|
12
|
+
This class provides methods for managing offers in Recruitee.
|
|
13
|
+
"""
|
|
14
|
+
def __init__(self, recruitee_client):
|
|
15
|
+
"""
|
|
16
|
+
Initialize the Offers API client.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
recruitee_client: An instance of the Recruitee client
|
|
20
|
+
"""
|
|
21
|
+
self.client = recruitee_client
|
|
22
|
+
|
|
23
|
+
def get_offers(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
24
|
+
"""
|
|
25
|
+
Get all offers from Recruitee.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
filters: Optional filters to apply
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
Response from the API
|
|
32
|
+
"""
|
|
33
|
+
return self.client.get(
|
|
34
|
+
endpoint="offers",
|
|
35
|
+
params=filters
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
def get_offer(self, offer_id: str, filters: Optional[Dict] = None) -> requests.Response:
|
|
39
|
+
"""
|
|
40
|
+
Get a specific offer from Recruitee.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
offer_id: The ID of the offer
|
|
44
|
+
filters: Optional filters to apply
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
Response from the API
|
|
48
|
+
"""
|
|
49
|
+
return self.client.get(
|
|
50
|
+
endpoint=f"offers/{offer_id}",
|
|
51
|
+
params=filters
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
def create_offer(self, title: str, description: str, **kwargs) -> requests.Response:
|
|
55
|
+
"""
|
|
56
|
+
Create a new offer in Recruitee.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
title: The title of the offer
|
|
60
|
+
description: The description of the offer
|
|
61
|
+
**kwargs: Additional offer attributes (recruiter_id, hiring_manager_id, etc.)
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
Response from the API
|
|
65
|
+
"""
|
|
66
|
+
data = {
|
|
67
|
+
'offer': {
|
|
68
|
+
'title': title,
|
|
69
|
+
'description': description,
|
|
70
|
+
**kwargs
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return self.post_offer(data)
|
|
74
|
+
|
|
75
|
+
def update_offer(self, offer_id: str, data: Dict) -> requests.Response:
|
|
76
|
+
"""
|
|
77
|
+
Update an existing offer in Recruitee.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
offer_id: The ID of the offer
|
|
81
|
+
data: The data to update
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
Response from the API
|
|
85
|
+
"""
|
|
86
|
+
return self.patch_offer(offer_id, data)
|
|
87
|
+
|
|
88
|
+
def post_offer(self, data: Dict) -> requests.Response:
|
|
89
|
+
"""
|
|
90
|
+
Create a new offer in Recruitee.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
data: The offer data
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
Response from the API
|
|
97
|
+
"""
|
|
98
|
+
return self.client.post(
|
|
99
|
+
endpoint="offers",
|
|
100
|
+
json=data
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
def patch_offer(self, offer_id: str, data: Dict) -> requests.Response:
|
|
104
|
+
"""
|
|
105
|
+
Update an existing offer in Recruitee.
|
|
106
|
+
|
|
107
|
+
Args:
|
|
108
|
+
offer_id: The ID of the offer
|
|
109
|
+
data: The data to update
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
Response from the API
|
|
113
|
+
"""
|
|
114
|
+
return self.client.patch(
|
|
115
|
+
endpoint=f"offers/{offer_id}",
|
|
116
|
+
json=data
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
def delete_offer(self, offer_id: str) -> requests.Response:
|
|
120
|
+
"""
|
|
121
|
+
Delete an offer from Recruitee.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
offer_id: The ID of the offer
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Response from the API
|
|
128
|
+
"""
|
|
129
|
+
return self.client.delete(
|
|
130
|
+
endpoint=f"offers/{offer_id}"
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
def patch_offer_slug(self, offer_id: str, data: Dict) -> requests.Response:
|
|
134
|
+
"""
|
|
135
|
+
Update an offer's slug in Recruitee.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
offer_id: The ID of the offer
|
|
139
|
+
data: The data to update
|
|
140
|
+
|
|
141
|
+
Returns:
|
|
142
|
+
Response from the API
|
|
143
|
+
"""
|
|
144
|
+
return self.client.patch(
|
|
145
|
+
endpoint=f"offers/{offer_id}/change_slug",
|
|
146
|
+
json=data
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
def post_add_offer_tag(self, offer_id: str, data: Dict) -> requests.Response:
|
|
150
|
+
"""
|
|
151
|
+
Add a tag to an offer.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
offer_id: The ID of the offer
|
|
155
|
+
data: The tag data
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
Response from the API
|
|
159
|
+
"""
|
|
160
|
+
return self.client.post(
|
|
161
|
+
endpoint=f"offers/{offer_id}/offer_tags",
|
|
162
|
+
json=data
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
def patch_publish_offer(self, offer_id: str) -> requests.Response:
|
|
166
|
+
"""
|
|
167
|
+
Publish an offer.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
offer_id: The ID of the offer
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
Response from the API
|
|
174
|
+
"""
|
|
175
|
+
return self.client.patch(
|
|
176
|
+
endpoint=f"offers/{offer_id}/publish"
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
def patch_unpublish_offer(self, offer_id: str) -> requests.Response:
|
|
180
|
+
"""
|
|
181
|
+
Unpublish an offer.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
offer_id: The ID of the offer
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
Response from the API
|
|
188
|
+
"""
|
|
189
|
+
return self.client.patch(
|
|
190
|
+
endpoint=f"offers/{offer_id}/unpublish"
|
|
191
|
+
)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Organization API module for Recruitee.
|
|
3
|
+
"""
|
|
4
|
+
from typing import Dict, Optional, List, Union
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Organization:
|
|
9
|
+
"""
|
|
10
|
+
Class for interacting with Recruitee organization API.
|
|
11
|
+
|
|
12
|
+
This class provides methods for managing organization entities in Recruitee,
|
|
13
|
+
including locations, departments, and companies.
|
|
14
|
+
"""
|
|
15
|
+
def __init__(self, recruitee_client):
|
|
16
|
+
"""
|
|
17
|
+
Initialize the Organization API client.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
recruitee_client: An instance of the Recruitee client
|
|
21
|
+
"""
|
|
22
|
+
self.client = recruitee_client
|
|
23
|
+
|
|
24
|
+
# Locations methods
|
|
25
|
+
def get_locations(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
26
|
+
"""
|
|
27
|
+
Get locations data from Recruitee.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
filters: Optional filters to apply
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
Response from the API
|
|
34
|
+
"""
|
|
35
|
+
return self.client.get(
|
|
36
|
+
endpoint="locations",
|
|
37
|
+
params=filters
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
# Departments methods
|
|
41
|
+
def get_departments(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
42
|
+
"""
|
|
43
|
+
Get departments data from Recruitee.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
filters: Optional filters to apply
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
Response from the API
|
|
50
|
+
"""
|
|
51
|
+
return self.client.get(
|
|
52
|
+
endpoint="departments",
|
|
53
|
+
params=filters
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
# Companies methods
|
|
57
|
+
def get_companies(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
58
|
+
"""
|
|
59
|
+
Get companies data from Recruitee.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
filters: Optional filters to apply
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
Response from the API
|
|
66
|
+
"""
|
|
67
|
+
return self.client.get(
|
|
68
|
+
endpoint="",
|
|
69
|
+
params=filters
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# Memberships methods
|
|
73
|
+
def get_memberships(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
74
|
+
"""
|
|
75
|
+
Get memberships data from Recruitee.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
filters: Optional filters to apply
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
Response from the API
|
|
82
|
+
"""
|
|
83
|
+
return self.client.get(
|
|
84
|
+
endpoint="memberships",
|
|
85
|
+
params=filters
|
|
86
|
+
)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Core Recruitee API client.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import requests
|
|
6
|
+
from typing import Union, List, Dict, Any, Optional, Literal
|
|
7
|
+
from brynq_sdk_brynq import BrynQ
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Recruitee(BrynQ):
|
|
11
|
+
"""
|
|
12
|
+
Core client for interacting with the Recruitee API.
|
|
13
|
+
|
|
14
|
+
This is the base client that provides low-level access to the Recruitee API.
|
|
15
|
+
For specific API endpoints, use the specialized classes like Candidates, Offers, and Organization.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
label: Label or list of labels for credentials
|
|
19
|
+
api_type: Type of API to use (default: "API")
|
|
20
|
+
"""
|
|
21
|
+
def __init__(self, system_type: Optional[Literal['source', 'target']] = None):
|
|
22
|
+
super().__init__()
|
|
23
|
+
self.timeout = 3600
|
|
24
|
+
credentials = self.interfaces.credentials.get(system="recruitee", system_type=system_type)
|
|
25
|
+
credentials = credentials.get('data')
|
|
26
|
+
self.base_url = f'https://api.recruitee.com/c/{credentials["company_id"]}/'
|
|
27
|
+
self.headers = {
|
|
28
|
+
"Authorization": f"Bearer {credentials['token']}",
|
|
29
|
+
"Content-Type": "application/json",
|
|
30
|
+
"x-recruitee-partner-name": "brynq",
|
|
31
|
+
"x-recruitee-partner-id": "86bza977z"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
def get(self, endpoint: str, params: Optional[Dict] = None) -> requests.Response:
|
|
35
|
+
"""
|
|
36
|
+
Make a GET request to the Recruitee API.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
endpoint: API endpoint to call
|
|
40
|
+
params: Optional parameters to include in the request
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
Response from the API
|
|
44
|
+
"""
|
|
45
|
+
url = f"{self.base_url}{endpoint}"
|
|
46
|
+
response = requests.get(url=url,
|
|
47
|
+
headers=self.headers,
|
|
48
|
+
params=params,
|
|
49
|
+
timeout=self.timeout)
|
|
50
|
+
response.raise_for_status()
|
|
51
|
+
return response
|
|
52
|
+
|
|
53
|
+
def post(self, endpoint: str, json: Optional[Dict] = None) -> requests.Response:
|
|
54
|
+
"""
|
|
55
|
+
Make a POST request to the Recruitee API.
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
endpoint: API endpoint to call
|
|
59
|
+
json: Optional JSON data to include in the request
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
Response from the API
|
|
63
|
+
"""
|
|
64
|
+
url = f"{self.base_url}{endpoint}"
|
|
65
|
+
return requests.post(url=url,
|
|
66
|
+
headers=self.headers,
|
|
67
|
+
json=json,
|
|
68
|
+
timeout=self.timeout)
|
|
69
|
+
|
|
70
|
+
def patch(self, endpoint: str, json: Optional[Dict] = None) -> requests.Response:
|
|
71
|
+
"""
|
|
72
|
+
Make a PATCH request to the Recruitee API.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
endpoint: API endpoint to call
|
|
76
|
+
json: Optional JSON data to include in the request
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
Response from the API
|
|
80
|
+
"""
|
|
81
|
+
url = f"{self.base_url}{endpoint}"
|
|
82
|
+
return requests.patch(url=url,
|
|
83
|
+
headers=self.headers,
|
|
84
|
+
json=json,
|
|
85
|
+
timeout=self.timeout)
|
|
86
|
+
|
|
87
|
+
def delete(self, endpoint: str) -> requests.Response:
|
|
88
|
+
"""
|
|
89
|
+
Make a DELETE request to the Recruitee API.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
endpoint: API endpoint to call
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
Response from the API
|
|
96
|
+
"""
|
|
97
|
+
url = f"{self.base_url}{endpoint}"
|
|
98
|
+
return requests.delete(url=url,
|
|
99
|
+
headers=self.headers,
|
|
100
|
+
timeout=self.timeout)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Vacancies API module for Recruitee.
|
|
3
|
+
"""
|
|
4
|
+
from typing import Dict, Optional, List, Union
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
from .offers import Offers
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Vacancies:
|
|
11
|
+
"""
|
|
12
|
+
Class for interacting with Recruitee vacancies API.
|
|
13
|
+
|
|
14
|
+
This class provides methods for creating, updating, and managing vacancies in Recruitee.
|
|
15
|
+
Operations are delegated to the Offers class for actual API interactions.
|
|
16
|
+
"""
|
|
17
|
+
def __init__(self, recruitee_client):
|
|
18
|
+
"""
|
|
19
|
+
Initialize the Vacancies API client.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
recruitee_client: An instance of the Recruitee client
|
|
23
|
+
"""
|
|
24
|
+
self.client = recruitee_client
|
|
25
|
+
self.offers = Offers(recruitee_client)
|
|
26
|
+
|
|
27
|
+
def create_vacancy(self, title: str, description: str, **kwargs) -> requests.Response:
|
|
28
|
+
"""
|
|
29
|
+
Create a new vacancy in Recruitee.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
title: The title of the vacancy
|
|
33
|
+
description: The description of the vacancy
|
|
34
|
+
**kwargs: Additional vacancy attributes (recruiter_id, hiring_manager_id, etc.)
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
Response from the API
|
|
38
|
+
"""
|
|
39
|
+
return self.offers.create_offer(title=title, description=description, **kwargs)
|
|
40
|
+
|
|
41
|
+
def update_vacancy(self, offer_id: str, data: Dict) -> requests.Response:
|
|
42
|
+
"""
|
|
43
|
+
Update an existing vacancy in Recruitee.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
offer_id: The ID of the offer
|
|
47
|
+
data: The data to update
|
|
48
|
+
|
|
49
|
+
Returns:
|
|
50
|
+
Response from the API
|
|
51
|
+
"""
|
|
52
|
+
return self.offers.update_offer(offer_id=offer_id, data=data)
|
|
53
|
+
|
|
54
|
+
def delete_vacancy(self, offer_id: str) -> requests.Response:
|
|
55
|
+
"""
|
|
56
|
+
Delete a vacancy from Recruitee.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
offer_id: The ID of the offer
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
Response from the API
|
|
63
|
+
"""
|
|
64
|
+
return self.offers.delete_offer(offer_id=offer_id)
|
|
65
|
+
|
|
66
|
+
def get_vacancies(self, filters: Optional[Dict] = None) -> requests.Response:
|
|
67
|
+
"""
|
|
68
|
+
Get all vacancies from Recruitee.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
filters: Optional filters to apply
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Response from the API
|
|
75
|
+
"""
|
|
76
|
+
return self.offers.get_offers(filters=filters)
|
|
77
|
+
|
|
78
|
+
def get_vacancy(self, offer_id: str, filters: Optional[Dict] = None) -> requests.Response:
|
|
79
|
+
"""
|
|
80
|
+
Get a specific vacancy from Recruitee.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
offer_id: The ID of the offer
|
|
84
|
+
filters: Optional filters to apply
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Response from the API
|
|
88
|
+
"""
|
|
89
|
+
return self.offers.get_offer(offer_id=offer_id, filters=filters)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: brynq_sdk_recruitee
|
|
3
|
+
Version: 3.0.1
|
|
4
|
+
Summary: Recruitee API SDK from BrynQ
|
|
5
|
+
Author: BrynQ
|
|
6
|
+
Author-email: support@brynq.com
|
|
7
|
+
License: BrynQ License
|
|
8
|
+
Requires-Dist: brynq-sdk-brynq<5,>=4
|
|
9
|
+
Requires-Dist: requests<3.0.0,>=2.31.0
|
|
10
|
+
Dynamic: author
|
|
11
|
+
Dynamic: author-email
|
|
12
|
+
Dynamic: description
|
|
13
|
+
Dynamic: license
|
|
14
|
+
Dynamic: requires-dist
|
|
15
|
+
Dynamic: summary
|
|
16
|
+
|
|
17
|
+
A Python SDK for interacting with the Recruitee API
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
brynq_sdk_recruitee/__init__.py,sha256=YhA2FLHZrDhkk98QEFjJhYdQByAfi947c-iEYx4oXQY,1728
|
|
2
|
+
brynq_sdk_recruitee/applicants.py,sha256=5-XbCWN-HOJyrK8XtYtSnN955w9JU_2W5VMa2My5xzk,2102
|
|
3
|
+
brynq_sdk_recruitee/candidates.py,sha256=ExqhxMHQ4J3YBucFd_zmsx0_htiludUCr3hooJMmLwI,3506
|
|
4
|
+
brynq_sdk_recruitee/offers.py,sha256=oMB07DIZwiBK_jtELGTqBBSPgzlOEEgozZfKAJ3yxC0,5014
|
|
5
|
+
brynq_sdk_recruitee/organization.py,sha256=ffWGpF9v3qWFrnqiyNVJ0FkK-HbG142XKtpKZo-Lzu0,2251
|
|
6
|
+
brynq_sdk_recruitee/recruitee.py,sha256=iwIdQ4SEqEldwRBQ3GMCxaAxSKPzfdXjuvCgmSnFm6g,3349
|
|
7
|
+
brynq_sdk_recruitee/vacancies.py,sha256=GYxQNa1DT7_E5ECqKhCBTrwX-yVM6a9twBf1DuI5gLg,2691
|
|
8
|
+
brynq_sdk_recruitee-3.0.1.dist-info/METADATA,sha256=wBFCh7wunX8KlA5vitkptkvvtTU2usGY9DyW7Jy-21s,415
|
|
9
|
+
brynq_sdk_recruitee-3.0.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
brynq_sdk_recruitee-3.0.1.dist-info/top_level.txt,sha256=vysAfrxoCaxhNaGPMZL-kF-CAyio2mEZGo6GQVK8QZ8,20
|
|
11
|
+
brynq_sdk_recruitee-3.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
brynq_sdk_recruitee
|