brynq-sdk-nmbrs 1.3.0__tar.gz → 1.3.2__tar.gz

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.
Files changed (42) hide show
  1. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/PKG-INFO +1 -1
  2. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/__init__.py +3 -2
  3. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/address.py +7 -6
  4. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/bank.py +21 -18
  5. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/companies.py +2 -0
  6. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/contract.py +21 -18
  7. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/costcenter.py +43 -36
  8. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/costunit.py +7 -3
  9. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/debtors.py +2 -0
  10. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/department.py +6 -3
  11. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/document.py +3 -2
  12. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/employees.py +25 -21
  13. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/employment.py +21 -18
  14. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/function.py +6 -3
  15. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/hours.py +14 -6
  16. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/salaries.py +8 -3
  17. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schedules.py +6 -3
  18. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/wagecomponents.py +12 -6
  19. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs.egg-info/PKG-INFO +1 -1
  20. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/setup.py +1 -1
  21. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/children.py +0 -0
  22. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/salary_tables.py +0 -0
  23. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/__init__.py +0 -0
  24. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/address.py +0 -0
  25. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/bank.py +0 -0
  26. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/contracts.py +0 -0
  27. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/costcenter.py +0 -0
  28. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/costunit.py +0 -0
  29. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/department.py +0 -0
  30. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/employees.py +0 -0
  31. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/employment.py +0 -0
  32. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/function.py +0 -0
  33. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/hours.py +0 -0
  34. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/salary.py +0 -0
  35. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/schedules.py +0 -0
  36. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs/schemas/wagecomponents.py +0 -0
  37. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs.egg-info/SOURCES.txt +0 -0
  38. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs.egg-info/dependency_links.txt +0 -0
  39. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs.egg-info/not-zip-safe +0 -0
  40. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs.egg-info/requires.txt +0 -0
  41. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/brynq_sdk_nmbrs.egg-info/top_level.txt +0 -0
  42. {brynq_sdk_nmbrs-1.3.0 → brynq_sdk_nmbrs-1.3.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_nmbrs
3
- Version: 1.3.0
3
+ Version: 1.3.2
4
4
  Summary: Nmbrs wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -36,6 +36,8 @@ class Nmbrs(BrynQ):
36
36
  mock_mode: If true, data will NOT be send to Nmbrs but only be tested for validity against Pydantic schemas
37
37
  """
38
38
  self.mock_mode = mock_mode
39
+ self.debug = debug
40
+ self.timeout = 3600
39
41
  if mock_mode is False:
40
42
  super().__init__()
41
43
  self.label = label
@@ -77,7 +79,6 @@ class Nmbrs(BrynQ):
77
79
  self.salary_tables = SalaryTables(self)
78
80
  self.salary_scales = SalaryScales(self)
79
81
  self.salary_steps = SalarySteps(self)
80
- self.debug = debug
81
82
 
82
83
  def _get_request_headers(self, label):
83
84
  initial_credentials = self.get_system_credential(system='nmbrs', label=label)
@@ -119,7 +120,7 @@ class Nmbrs(BrynQ):
119
120
  while has_next_page:
120
121
  prepped = request.prepare()
121
122
  prepped.headers.update(self.session.headers)
122
- resp = self.session.send(prepped)
123
+ resp = self.session.send(prepped, timeout=self.nmbrs.timeout)
123
124
  resp.raise_for_status()
124
125
  response_data = resp.json()
125
126
  result_data += response_data['data']
@@ -38,28 +38,29 @@ class Address:
38
38
  def create(self, employee_id: str, data: Dict[str, Any]):
39
39
  """
40
40
  Create a new address for an employee using Pydantic validation.
41
-
41
+
42
42
  Args:
43
43
  employee_id: The ID of the employee
44
44
  data: Dictionary containing address data with fields matching
45
45
  the AddressCreate schema (using camelCase field names)
46
-
46
+
47
47
  Returns:
48
48
  Response from the API
49
- """
49
+ """
50
50
  # Validate with Pydantic model - this will raise an error if required fields are missing
51
51
  address_model = AddressCreate(**data)
52
52
 
53
53
  if self.nmbrs.mock_mode:
54
54
  return address_model
55
-
55
+
56
56
  # Convert validated model to dict for API payload
57
57
  payload = address_model.dict(exclude_none=True)
58
-
58
+
59
59
  # Send request
60
60
  resp = self.nmbrs.session.post(
61
61
  url=f"{self.nmbrs.base_url}employees/{employee_id}/address",
62
- json=payload
62
+ json=payload,
63
+ timeout=self.nmbrs.timeout
63
64
  )
64
65
  return resp
65
66
 
@@ -45,76 +45,79 @@ class Bank:
45
45
  def create(self, employee_id: str, data: Dict[str, Any]):
46
46
  """
47
47
  Create a new bank account for an employee using Pydantic validation.
48
-
48
+
49
49
  Args:
50
50
  employee_id: The ID of the employee
51
51
  data: Dictionary containing bank account data in the format matching BankCreate schema
52
-
52
+
53
53
  Returns:
54
54
  Response from the API
55
55
  """
56
56
  # Validate with Pydantic model - this will raise an error if required fields are missing
57
57
  bank_model = BankCreate(**data)
58
-
58
+
59
59
  if self.nmbrs.mock_mode:
60
60
  return bank_model
61
-
61
+
62
62
  # Convert validated model to dict for API payload
63
63
  payload = bank_model.dict(exclude_none=True)
64
-
64
+
65
65
  # Send request
66
66
  resp = self.nmbrs.session.post(
67
67
  url=f"{self.nmbrs.base_url}employees/{employee_id}/bankaccount",
68
- json=payload
68
+ json=payload,
69
+ timeout=self.nmbrs.timeout
69
70
  )
70
71
  return resp
71
72
 
72
73
  def update(self, employee_id: str, data: Dict[str, Any]):
73
74
  """
74
75
  Update a bank account for an employee using Pydantic validation.
75
-
76
+
76
77
  Args:
77
78
  employee_id: The ID of the employee
78
79
  data: Dictionary containing bank account data in the format matching BankUpdate schema
79
-
80
+
80
81
  Returns:
81
82
  Response from the API
82
83
  """
83
84
  # Validate with Pydantic model - this will raise an error if required fields are missing
84
85
  bank_model = BankUpdate(**data)
85
-
86
+
86
87
  if self.nmbrs.mock_mode:
87
88
  return bank_model
88
-
89
+
89
90
  # Convert validated model to dict for API payload
90
91
  payload = bank_model.dict(exclude_none=True)
91
-
92
+
92
93
  # Send request
93
94
  resp = self.nmbrs.session.put(
94
95
  url=f"{self.nmbrs.base_url}employees/{employee_id}/bankaccount",
95
- json=payload
96
+ json=payload,
97
+ timeout=self.nmbrs.timeout
96
98
  )
97
99
  return resp
98
-
100
+
99
101
  def delete(self, employee_id: str, bank_account_id: str):
100
102
  """
101
103
  Delete a bank account for an employee.
102
-
104
+
103
105
  Args:
104
106
  employee_id: The ID of the employee
105
107
  bank_account_id: The ID of the bank account to delete
106
-
108
+
107
109
  Returns:
108
110
  Response from the API
109
111
  """
110
112
  # Create and validate a BankDelete model
111
113
  bank_model = BankDelete(bankAccountId=bank_account_id)
112
-
114
+
113
115
  if self.nmbrs.mock_mode:
114
116
  return bank_model
115
-
117
+
116
118
  # Send request
117
119
  resp = self.nmbrs.session.delete(
118
- url=f"{self.nmbrs.base_url}employees/{employee_id}/bankaccounts/{bank_account_id}"
120
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/bankaccounts/{bank_account_id}",
121
+ timeout=self.nmbrs.timeout
119
122
  )
120
123
  return resp
@@ -24,6 +24,8 @@ class Companies:
24
24
  request = requests.Request(method='GET',
25
25
  url=f"{self.nmbrs.base_url}companies")
26
26
  data = self.nmbrs.get_paginated_result(request)
27
+ df = pd.DataFrame(data)
28
+
27
29
  return df
28
30
 
29
31
  def get_soap_ids(self) -> pd.DataFrame:
@@ -48,78 +48,81 @@ class Contract:
48
48
  def create(self, employee_id: str, data: Dict[str, Any]):
49
49
  """
50
50
  Create a new contract for an employee using Pydantic validation.
51
-
51
+
52
52
  Args:
53
53
  employee_id: The ID of the employee
54
54
  data: Dictionary containing contract data with fields matching
55
55
  the ContractCreate schema (using camelCase field names)
56
-
56
+
57
57
  Returns:
58
58
  Response from the API
59
59
  """
60
60
  # Validate with Pydantic model - this will raise an error if required fields are missing
61
61
  contract_model = ContractCreate(**data)
62
-
62
+
63
63
  if self.nmbrs.mock_mode:
64
64
  return contract_model
65
-
65
+
66
66
  # Convert validated model to dict for API payload
67
67
  payload = contract_model.dict(exclude_none=True)
68
-
68
+
69
69
  # Send request
70
70
  resp = self.nmbrs.session.post(
71
71
  url=f"{self.nmbrs.base_url}employees/{employee_id}/contract",
72
- json=payload
72
+ json=payload,
73
+ timeout=self.nmbrs.timeout
73
74
  )
74
75
  return resp
75
76
 
76
77
  def update(self, employee_id: str, data: Dict[str, Any]):
77
78
  """
78
79
  Update a contract for an employee using Pydantic validation.
79
-
80
+
80
81
  Args:
81
82
  employee_id: The ID of the employee
82
83
  data: Dictionary containing contract data with fields matching
83
84
  the ContractUpdate schema (using camelCase field names)
84
-
85
+
85
86
  Returns:
86
87
  Response from the API
87
88
  """
88
89
  # Validate with Pydantic model - this will raise an error if required fields are missing
89
90
  contract_model = ContractUpdate(**data)
90
-
91
+
91
92
  if self.nmbrs.mock_mode:
92
93
  return contract_model
93
-
94
+
94
95
  # Convert validated model to dict for API payload
95
96
  payload = contract_model.dict(exclude_none=True)
96
-
97
+
97
98
  # Send request
98
99
  resp = self.nmbrs.session.put(
99
100
  url=f"{self.nmbrs.base_url}employees/{employee_id}/contract",
100
- json=payload
101
+ json=payload,
102
+ timeout=self.nmbrs.timeout
101
103
  )
102
104
  return resp
103
-
105
+
104
106
  def delete(self, employee_id: str, contract_id: str):
105
107
  """
106
108
  Delete a contract for an employee.
107
-
109
+
108
110
  Args:
109
111
  employee_id: The ID of the employee
110
112
  contract_id: The ID of the contract to delete
111
-
113
+
112
114
  Returns:
113
115
  Response from the API
114
116
  """
115
117
  # Create and validate a ContractDelete model
116
118
  contract_model = ContractDelete(contractId=contract_id)
117
-
119
+
118
120
  if self.nmbrs.mock_mode:
119
121
  return contract_model
120
-
122
+
121
123
  # Send request
122
124
  resp = self.nmbrs.session.delete(
123
- url=f"{self.nmbrs.base_url}employees/{employee_id}/contracts/{contract_id}"
125
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/contracts/{contract_id}",
126
+ timeout=self.nmbrs.timeout
124
127
  )
125
128
  return resp
@@ -49,79 +49,82 @@ class EmployeeCostcenter:
49
49
  def create(self, employee_id: str, data: Dict[str, Any]):
50
50
  """
51
51
  Create a new costcenter for an employee using Pydantic validation.
52
-
52
+
53
53
  Args:
54
54
  employee_id: The ID of the employee
55
55
  data: Dictionary containing costcenter data with fields matching
56
56
  the EmployeeCostcenterCreate schema (using camelCase field names)
57
-
57
+
58
58
  Returns:
59
59
  Response from the API
60
60
  """
61
61
  # Validate with Pydantic model - this will raise an error if required fields are missing
62
62
  costcenter_model = EmployeeCostcenterCreate(**data)
63
-
63
+
64
64
  if self.nmbrs.mock_mode:
65
65
  return costcenter_model
66
-
66
+
67
67
  # Convert validated model to dict for API payload
68
68
  payload = costcenter_model.dict(exclude_none=True)
69
-
69
+
70
70
  # Send request
71
71
  resp = self.nmbrs.session.post(
72
72
  url=f"{self.nmbrs.base_url}employees/{employee_id}/costcenter",
73
- json=payload
73
+ json=payload,
74
+ timeout=self.nmbrs.timeout
74
75
  )
75
76
  return resp
76
77
 
77
78
  def update(self, employee_id: str, data: Dict[str, Any]):
78
79
  """
79
80
  Update a costcenter for an employee using Pydantic validation.
80
-
81
+
81
82
  Args:
82
83
  employee_id: The ID of the employee
83
84
  data: Dictionary containing costcenter data with fields matching
84
85
  the EmployeeCostcenterUpdate schema (using camelCase field names)
85
-
86
+
86
87
  Returns:
87
88
  Response from the API
88
89
  """
89
90
  # Validate with Pydantic model - this will raise an error if required fields are missing
90
91
  costcenter_model = EmployeeCostcenterUpdate(**data)
91
-
92
+
92
93
  if self.nmbrs.mock_mode:
93
94
  return costcenter_model
94
-
95
+
95
96
  # Convert validated model to dict for API payload
96
97
  payload = costcenter_model.dict(exclude_none=True)
97
-
98
+
98
99
  # Send request
99
100
  resp = self.nmbrs.session.put(
100
101
  url=f"{self.nmbrs.base_url}employees/{employee_id}/costcenter",
101
- json=payload
102
+ json=payload,
103
+ timeout=self.nmbrs.timeout
102
104
  )
103
105
  return resp
104
-
106
+
105
107
  def delete(self, employee_id: str, employee_cost_center_id: str):
106
108
  """
107
109
  Delete a costcenter for an employee.
108
-
110
+
109
111
  Args:
110
112
  employee_id: The ID of the employee
111
113
  employee_cost_center_id: The ID of the costcenter to delete
112
-
114
+
113
115
  Returns:
114
116
  Response from the API
115
117
  """
116
118
  # Create and validate a EmployeeCostcenterDelete model
117
119
  costcenter_model = EmployeeCostcenterDelete(employeeCostCenterId=employee_cost_center_id)
118
-
120
+
119
121
  if self.nmbrs.mock_mode:
120
122
  return costcenter_model
121
-
123
+
122
124
  # Send request
123
125
  resp = self.nmbrs.session.delete(
124
- url=f"{self.nmbrs.base_url}employees/{employee_id}/costcenters/{employee_cost_center_id}"
126
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/costcenters/{employee_cost_center_id}",
127
+ timeout=self.nmbrs.timeout
125
128
  )
126
129
  return resp
127
130
 
@@ -144,84 +147,88 @@ class Costcenter:
144
147
  request = requests.Request(method='GET',
145
148
  url=f"{self.nmbrs.base_url}companies/{company_id}/costcenters")
146
149
  data = self.nmbrs.get_paginated_result(request)
150
+ df = pd.DataFrame(data)
147
151
 
148
152
  return df
149
153
 
150
154
  def create(self, company_id: str, data: Dict[str, Any]):
151
155
  """
152
156
  Create a new costcenter using Pydantic validation.
153
-
157
+
154
158
  Args:
155
159
  company_id: The ID of the company
156
160
  data: Dictionary containing costcenter data with fields matching
157
161
  the CostcenterCreate schema (using camelCase field names)
158
-
162
+
159
163
  Returns:
160
164
  Response from the API
161
165
  """
162
166
  # Validate with Pydantic model - this will raise an error if required fields are missing
163
167
  costcenter_model = CostcenterCreate(**data)
164
-
168
+
165
169
  if self.nmbrs.mock_mode:
166
170
  return costcenter_model
167
-
171
+
168
172
  # Convert validated model to dict for API payload
169
173
  payload = costcenter_model.dict(exclude_none=True)
170
-
174
+
171
175
  # Send request
172
176
  resp = self.nmbrs.session.post(
173
177
  url=f"{self.nmbrs.base_url}companies/{company_id}/costcenter",
174
- json=payload
178
+ json=payload,
179
+ timeout=self.nmbrs.timeout
175
180
  )
176
181
  return resp
177
182
 
178
183
  def update(self, company_id: str, data: Dict[str, Any]):
179
184
  """
180
185
  Update a costcenter using Pydantic validation.
181
-
186
+
182
187
  Args:
183
188
  company_id: The ID of the company
184
189
  data: Dictionary containing costcenter data with fields matching
185
190
  the CostcenterUpdate schema (using camelCase field names)
186
-
191
+
187
192
  Returns:
188
193
  Response from the API
189
194
  """
190
195
  # Validate with Pydantic model - this will raise an error if required fields are missing
191
196
  costcenter_model = CostcenterUpdate(**data)
192
-
197
+
193
198
  if self.nmbrs.mock_mode:
194
199
  return costcenter_model
195
-
200
+
196
201
  # Convert validated model to dict for API payload
197
202
  payload = costcenter_model.dict(exclude_none=True)
198
-
203
+
199
204
  # Send request
200
205
  resp = self.nmbrs.session.put(
201
206
  url=f"{self.nmbrs.base_url}companies/{company_id}/costcenter",
202
- json=payload
207
+ json=payload,
208
+ timeout=self.nmbrs.timeout
203
209
  )
204
210
  return resp
205
-
211
+
206
212
  def delete(self, company_id: str, cost_center_id: str):
207
213
  """
208
214
  Delete a costcenter.
209
-
215
+
210
216
  Args:
211
217
  company_id: The ID of the company
212
218
  cost_center_id: The ID of the costcenter to delete
213
-
219
+
214
220
  Returns:
215
221
  Response from the API
216
222
  """
217
223
  # Create and validate a CostcenterDelete model
218
224
  costcenter_model = CostcenterDelete(costCenterId=cost_center_id)
219
-
225
+
220
226
  if self.nmbrs.mock_mode:
221
227
  return costcenter_model
222
-
228
+
223
229
  # Send request
224
230
  resp = self.nmbrs.session.delete(
225
- url=f"{self.nmbrs.base_url}companies/{company_id}/costcenters/{cost_center_id}"
231
+ url=f"{self.nmbrs.base_url}companies/{company_id}/costcenters/{cost_center_id}",
232
+ timeout=self.nmbrs.timeout
226
233
  )
227
234
  return resp
@@ -25,6 +25,7 @@ class Costunit:
25
25
  url=f"{self.nmbrs.base_url}companies/{company_id}/costunits")
26
26
 
27
27
  data = self.nmbrs.get_paginated_result(request)
28
+ df = pd.DataFrame(data)
28
29
 
29
30
  return df
30
31
 
@@ -52,7 +53,8 @@ class Costunit:
52
53
  # Send request
53
54
  resp = self.nmbrs.session.post(
54
55
  url=f"{self.nmbrs.base_url}companies/{company_id}/costunit",
55
- json=payload
56
+ json=payload,
57
+ timeout=self.nmbrs.timeout
56
58
  )
57
59
  return resp
58
60
 
@@ -80,7 +82,8 @@ class Costunit:
80
82
  # Send request
81
83
  resp = self.nmbrs.session.put(
82
84
  url=f"{self.nmbrs.base_url}companies/{company_id}/costunit",
83
- json=payload
85
+ json=payload,
86
+ timeout=self.nmbrs.timeout
84
87
  )
85
88
  return resp
86
89
 
@@ -103,6 +106,7 @@ class Costunit:
103
106
 
104
107
  # Send request
105
108
  resp = self.nmbrs.session.delete(
106
- url=f"{self.nmbrs.base_url}companies/{company_id}/costunits/{cost_unit_id}"
109
+ url=f"{self.nmbrs.base_url}companies/{company_id}/costunits/{cost_unit_id}",
110
+ timeout=self.nmbrs.timeout
107
111
  )
108
112
  return resp
@@ -19,4 +19,6 @@ class Debtors:
19
19
  url=f"{self.nmbrs.base_url}debtors")
20
20
  data = self.nmbrs.get_paginated_result(request)
21
21
 
22
+ df = pd.DataFrame(data)
23
+
22
24
  return df
@@ -67,7 +67,8 @@ class EmployeeDepartment:
67
67
  # Send request
68
68
  resp = self.nmbrs.session.post(
69
69
  url=f"{self.nmbrs.base_url}employees/{employee_id}/department",
70
- json=payload
70
+ json=payload,
71
+ timeout=self.nmbrs.timeout
71
72
  )
72
73
  return resp
73
74
 
@@ -95,7 +96,8 @@ class EmployeeDepartment:
95
96
  # Send request
96
97
  resp = self.nmbrs.session.put(
97
98
  url=f"{self.nmbrs.base_url}employees/{employee_id}/department",
98
- json=payload
99
+ json=payload,
100
+ timeout=self.nmbrs.timeout
99
101
  )
100
102
  return resp
101
103
 
@@ -118,7 +120,8 @@ class EmployeeDepartment:
118
120
 
119
121
  # Send request
120
122
  resp = self.nmbrs.session.delete(
121
- url=f"{self.nmbrs.base_url}employees/{employee_id}/departments/{department_id}"
123
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/departments/{department_id}",
124
+ timeout=self.nmbrs.timeout
122
125
  )
123
126
 
124
127
 
@@ -18,11 +18,12 @@ class Payslip:
18
18
  if year:
19
19
  params['year'] = year
20
20
  resp = self.nmbrs.session.get(f"{self.nmbrs.base_url}employees/{employee_id}/payslipperperiod/",
21
- params=params)
21
+ params=params,
22
+ timeout=self.nmbrs.timeout)
22
23
  resp.raise_for_status()
23
24
  task_id = resp.json()['taskId']
24
25
 
25
- resp = self.nmbrs.session.get(f"{self.nmbrs.base_url}documents/{task_id}")
26
+ resp = self.nmbrs.session.get(f"{self.nmbrs.base_url}documents/{task_id}", timeout=self.nmbrs.timeout)
26
27
 
27
28
  return BytesIO(resp.content)
28
29
 
@@ -76,60 +76,62 @@ class Employees:
76
76
  def create(self, company_id: str, data: Dict[str, Any]):
77
77
  """
78
78
  Create a new employee using Pydantic validation.
79
-
79
+
80
80
  Args:
81
81
  company_id: The ID of the company
82
82
  data: Dictionary structured according to the EmployeeCreate schema with:
83
83
  - PersonalInfo: containing basicInfo, birthInfo, contactInfo, etc.
84
84
  - AdditionalEmployeeInfo: containing service date, etc.
85
-
85
+
86
86
  Returns:
87
87
  Response from the API
88
88
  """
89
89
  # Validate with Pydantic model
90
90
  employee_model = EmployeeCreate(**data)
91
-
91
+
92
92
  if self.nmbrs.mock_mode:
93
93
  return employee_model
94
-
94
+
95
95
  # Convert validated model to dict for API payload
96
96
  payload = employee_model.dict(exclude_none=True)
97
-
97
+
98
98
  # Send request
99
99
  resp = self.nmbrs.session.post(
100
100
  url=f"{self.nmbrs.base_url}companies/{company_id}/employees",
101
- json=payload
101
+ json=payload,
102
+ timeout=self.nmbrs.timeout
102
103
  )
103
104
  return resp
104
105
 
105
106
  def update(self, employee_id: str, data: Dict[str, Any]):
106
107
  """
107
108
  Update an employee using Pydantic validation.
108
-
109
+
109
110
  Args:
110
111
  employee_id: The ID of the employee
111
112
  data: Dictionary structured according to the EmployeeUpdate schema with:
112
113
  - employeeId: The ID of the employee to update
113
114
  - personalInfo: containing any of basicInfo, birthInfo, contactInfo, etc.
114
-
115
+
115
116
  Returns:
116
117
  Response from the API
117
118
  """
118
119
  # Validate with Pydantic model
119
120
  employee_model = EmployeeUpdate(**data)
120
-
121
+
121
122
  if self.nmbrs.mock_mode:
122
123
  return employee_model
123
-
124
+
124
125
  # Convert validated model to dict for API payload
125
126
  payload = employee_model.dict(exclude_none=True)
126
-
127
+
127
128
  # Send request
128
129
  resp = self.nmbrs.session.put(
129
130
  url=f"{self.nmbrs.base_url}employees/{employee_id}/personalInfo",
130
- json=payload
131
+ json=payload,
132
+ timeout=self.nmbrs.timeout
131
133
  )
132
-
134
+
133
135
  # Handle social security number update if present
134
136
  if 'socialSecurityNumber' in data:
135
137
  social_security_payload = {
@@ -137,29 +139,31 @@ class Employees:
137
139
  }
138
140
  resp = self.nmbrs.session.put(
139
141
  url=f"{self.nmbrs.base_url}employees/{employee_id}/social_security_number",
140
- json=social_security_payload
142
+ json=social_security_payload,
143
+ timeout=self.nmbrs.timeout
141
144
  )
142
-
145
+
143
146
  return resp
144
-
147
+
145
148
  def delete(self, employee_id: str):
146
149
  """
147
150
  Delete an employee.
148
-
151
+
149
152
  Args:
150
153
  employee_id: The ID of the employee to delete
151
-
154
+
152
155
  Returns:
153
156
  Response from the API
154
157
  """
155
158
  # Create and validate an EmployeeDelete model
156
159
  employee_model = EmployeeDelete(employeeId=employee_id)
157
-
160
+
158
161
  if self.nmbrs.mock_mode:
159
162
  return employee_model
160
-
163
+
161
164
  # Send request
162
165
  resp = self.nmbrs.session.delete(
163
- url=f"{self.nmbrs.base_url}employees/{employee_id}"
166
+ url=f"{self.nmbrs.base_url}employees/{employee_id}",
167
+ timeout=self.nmbrs.timeout
164
168
  )
165
169
  return resp
@@ -49,78 +49,81 @@ class Employment:
49
49
  def create(self, employee_id: str, data: Dict[str, Any]):
50
50
  """
51
51
  Create a new employment record for an employee using Pydantic validation.
52
-
52
+
53
53
  Args:
54
54
  employee_id: The ID of the employee
55
55
  data: Dictionary containing employment data with fields matching
56
56
  the EmploymentCreate schema (using camelCase field names)
57
-
57
+
58
58
  Returns:
59
59
  Response from the API
60
60
  """
61
61
  # Validate with Pydantic model
62
62
  employment_model = EmploymentCreate(**data)
63
-
63
+
64
64
  if self.nmbrs.mock_mode:
65
65
  return employment_model
66
-
66
+
67
67
  # Convert validated model to dict for API payload
68
68
  payload = employment_model.dict(exclude_none=True)
69
-
69
+
70
70
  # Send request
71
71
  resp = self.nmbrs.session.post(
72
72
  url=f"{self.nmbrs.base_url}employees/{employee_id}/employment",
73
- json=payload
73
+ json=payload,
74
+ timeout=self.nmbrs.timeout
74
75
  )
75
76
  return resp
76
77
 
77
78
  def update(self, employee_id: str, data: Dict[str, Any]):
78
79
  """
79
80
  Update an employment record for an employee using Pydantic validation.
80
-
81
+
81
82
  Args:
82
83
  employee_id: The ID of the employee
83
84
  data: Dictionary containing employment data with fields matching
84
85
  the EmploymentUpdate schema (using camelCase field names)
85
-
86
+
86
87
  Returns:
87
88
  Response from the API
88
89
  """
89
90
  # Validate with Pydantic model
90
91
  employment_model = EmploymentUpdate(**data)
91
-
92
+
92
93
  if self.nmbrs.mock_mode:
93
94
  return employment_model
94
-
95
+
95
96
  # Convert validated model to dict for API payload
96
97
  payload = employment_model.dict(exclude_none=True)
97
-
98
+
98
99
  # Send request
99
100
  resp = self.nmbrs.session.put(
100
101
  url=f"{self.nmbrs.base_url}employees/{employee_id}/employment",
101
- json=payload
102
+ json=payload,
103
+ timeout=self.nmbrs.timeout
102
104
  )
103
105
  return resp
104
-
106
+
105
107
  def delete(self, employee_id: str, employment_id: str):
106
108
  """
107
109
  Delete an employment record for an employee.
108
-
110
+
109
111
  Args:
110
112
  employee_id: The ID of the employee
111
113
  employment_id: The ID of the employment record to delete
112
-
114
+
113
115
  Returns:
114
116
  Response from the API
115
117
  """
116
118
  # Create and validate an EmploymentDelete model
117
119
  employment_model = EmploymentDelete(employmentId=employment_id)
118
-
120
+
119
121
  if self.nmbrs.mock_mode:
120
122
  return employment_model
121
-
123
+
122
124
  # Send request
123
125
  resp = self.nmbrs.session.delete(
124
- url=f"{self.nmbrs.base_url}employees/{employee_id}/employments/{employment_id}"
126
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/employments/{employment_id}",
127
+ timeout=self.nmbrs.timeout
125
128
  )
126
129
  return resp
@@ -62,7 +62,8 @@ class EmployeeFunction:
62
62
  # Send request
63
63
  resp = self.nmbrs.session.post(
64
64
  url=f"{self.nmbrs.base_url}employees/{employee_id}/function",
65
- json=payload
65
+ json=payload,
66
+ timeout=self.nmbrs.timeout
66
67
  )
67
68
  return resp
68
69
 
@@ -90,7 +91,8 @@ class EmployeeFunction:
90
91
  # Send request
91
92
  resp = self.nmbrs.session.put(
92
93
  url=f"{self.nmbrs.base_url}employees/{employee_id}/function",
93
- json=payload
94
+ json=payload,
95
+ timeout=self.nmbrs.timeout
94
96
  )
95
97
  return resp
96
98
 
@@ -113,7 +115,8 @@ class EmployeeFunction:
113
115
 
114
116
  # Send request
115
117
  resp = self.nmbrs.session.delete(
116
- url=f"{self.nmbrs.base_url}employees/{employee_id}/functions/{function_id}"
118
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/functions/{function_id}",
119
+ timeout=self.nmbrs.timeout
117
120
  )
118
121
  return resp
119
122
 
@@ -43,6 +43,8 @@ class VariableHours:
43
43
  params=params)
44
44
 
45
45
  data = self.nmbrs.get_paginated_result(request)
46
+
47
+ df = pd.DataFrame(data)
46
48
 
47
49
  df['employee_id'] = employee_id # Add employee_id for tracking
48
50
 
@@ -75,7 +77,8 @@ class VariableHours:
75
77
  # Send request
76
78
  resp = self.nmbrs.session.post(
77
79
  url=f"{self.nmbrs.base_url}employees/{employee_id}/variablehours",
78
- json=payload
80
+ json=payload,
81
+ timeout=self.nmbrs.timeout
79
82
  )
80
83
  return resp
81
84
 
@@ -103,7 +106,8 @@ class VariableHours:
103
106
  # Send request
104
107
  resp = self.nmbrs.session.put(
105
108
  url=f"{self.nmbrs.base_url}employees/{employee_id}/variablehours",
106
- json=payload
109
+ json=payload,
110
+ timeout=self.nmbrs.timeout
107
111
  )
108
112
  return resp
109
113
 
@@ -126,7 +130,8 @@ class VariableHours:
126
130
 
127
131
  # Send request
128
132
  resp = self.nmbrs.session.delete(
129
- url=f"{self.nmbrs.base_url}employees/{employee_id}/hours/{hourcomponent_id}"
133
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/hours/{hourcomponent_id}",
134
+ timeout=self.nmbrs.timeout
130
135
  )
131
136
  return resp
132
137
 
@@ -182,7 +187,8 @@ class FixedHours:
182
187
  # Send request
183
188
  resp = self.nmbrs.session.post(
184
189
  url=f"{self.nmbrs.base_url}employees/{employee_id}/fixedhours",
185
- json=payload
190
+ json=payload,
191
+ timeout=self.nmbrs.timeout
186
192
  )
187
193
  return resp
188
194
 
@@ -210,7 +216,8 @@ class FixedHours:
210
216
  # Send request
211
217
  resp = self.nmbrs.session.put(
212
218
  url=f"{self.nmbrs.base_url}employees/{employee_id}/fixedhours",
213
- json=payload
219
+ json=payload,
220
+ timeout=self.nmbrs.timeout
214
221
  )
215
222
  return resp
216
223
 
@@ -233,6 +240,7 @@ class FixedHours:
233
240
 
234
241
  # Send request
235
242
  resp = self.nmbrs.session.delete(
236
- url=f"{self.nmbrs.base_url}employees/{employee_id}/hours/{hourcomponent_id}"
243
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/hours/{hourcomponent_id}",
244
+ timeout=self.nmbrs.timeout
237
245
  )
238
246
  return resp
@@ -49,6 +49,8 @@ class Salaries:
49
49
  params=params)
50
50
  data = self.nmbrs.get_paginated_result(request)
51
51
 
52
+ df = pd.DataFrame(data)
53
+
52
54
  return df
53
55
 
54
56
  def create(self, employee_id: str, data: Dict[str, Any]):
@@ -75,7 +77,8 @@ class Salaries:
75
77
  # Send request
76
78
  resp = self.nmbrs.session.post(
77
79
  url=f"{self.nmbrs.base_url}employees/{employee_id}/salary",
78
- json=payload
80
+ json=payload,
81
+ timeout=self.nmbrs.timeout
79
82
  )
80
83
  return resp
81
84
 
@@ -103,7 +106,8 @@ class Salaries:
103
106
  # Send request
104
107
  resp = self.nmbrs.session.put(
105
108
  url=f"{self.nmbrs.base_url}employees/{employee_id}/salary",
106
- json=payload
109
+ json=payload,
110
+ timeout=self.nmbrs.timeout
107
111
  )
108
112
  return resp
109
113
 
@@ -126,6 +130,7 @@ class Salaries:
126
130
 
127
131
  # Send request
128
132
  resp = self.nmbrs.session.delete(
129
- url=f"{self.nmbrs.base_url}employees/{employee_id}/salaries/{salary_id}"
133
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/salaries/{salary_id}",
134
+ timeout=self.nmbrs.timeout
130
135
  )
131
136
  return resp
@@ -111,7 +111,8 @@ class Schedule:
111
111
  # Use the validated data for the API call
112
112
  resp = self.nmbrs.session.post(
113
113
  url=f"{self.nmbrs.base_url}employees/{employee_id}/schedule",
114
- json=validated_data.dict(exclude_none=True)
114
+ json=validated_data.dict(exclude_none=True),
115
+ timeout=self.nmbrs.timeout
115
116
  )
116
117
  return resp
117
118
 
@@ -142,7 +143,8 @@ class Schedule:
142
143
  # Send request
143
144
  resp = self.nmbrs.session.put(
144
145
  url=f"{self.nmbrs.base_url}employees/{employee_id}/schedule",
145
- json=payload
146
+ json=payload,
147
+ timeout=self.nmbrs.timeout
146
148
  )
147
149
  return resp
148
150
 
@@ -165,6 +167,7 @@ class Schedule:
165
167
 
166
168
  # Send request
167
169
  resp = self.nmbrs.session.delete(
168
- url=f"{self.nmbrs.base_url}employees/{employee_id}/schedules/{schedule_id}"
170
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/schedules/{schedule_id}",
171
+ timeout=self.nmbrs.timeout
169
172
  )
170
173
  return resp
@@ -83,7 +83,8 @@ class EmployeeFixedWageComponents:
83
83
  # Send request
84
84
  resp = self.nmbrs.session.post(
85
85
  url=f"{self.nmbrs.base_url}employees/{employee_id}/fixedwagecomponent",
86
- json=payload
86
+ json=payload,
87
+ timeout=self.nmbrs.timeout
87
88
  )
88
89
  return resp
89
90
 
@@ -111,7 +112,8 @@ class EmployeeFixedWageComponents:
111
112
  # Send request
112
113
  resp = self.nmbrs.session.put(
113
114
  url=f"{self.nmbrs.base_url}employees/{employee_id}/fixedwagecomponent",
114
- json=payload
115
+ json=payload,
116
+ timeout=self.nmbrs.timeout
115
117
  )
116
118
  return resp
117
119
 
@@ -133,7 +135,8 @@ class EmployeeFixedWageComponents:
133
135
  return delete_model
134
136
 
135
137
  resp = self.nmbrs.session.delete(
136
- url=f"{self.nmbrs.base_url}employees/{employee_id}/wagecomponents/{wagecomponent_id}"
138
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/wagecomponents/{wagecomponent_id}",
139
+ timeout=self.nmbrs.timeout
137
140
  )
138
141
  return resp
139
142
 
@@ -207,7 +210,8 @@ class EmployeeVariableWageComponents:
207
210
  # Send request
208
211
  resp = self.nmbrs.session.post(
209
212
  url=f"{self.nmbrs.base_url}employees/{employee_id}/variablewagecomponent",
210
- json=payload
213
+ json=payload,
214
+ timeout=self.nmbrs.timeout
211
215
  )
212
216
  return resp
213
217
 
@@ -235,7 +239,8 @@ class EmployeeVariableWageComponents:
235
239
  # Send request
236
240
  resp = self.nmbrs.session.put(
237
241
  url=f"{self.nmbrs.base_url}employees/{employee_id}/variablewagecomponent",
238
- json=payload
242
+ json=payload,
243
+ timeout=self.nmbrs.timeout
239
244
  )
240
245
  return resp
241
246
 
@@ -257,6 +262,7 @@ class EmployeeVariableWageComponents:
257
262
  return delete_model
258
263
 
259
264
  resp = self.nmbrs.session.delete(
260
- url=f"{self.nmbrs.base_url}employees/{employee_id}/wagecomponents/{wagecomponent_id}"
265
+ url=f"{self.nmbrs.base_url}employees/{employee_id}/wagecomponents/{wagecomponent_id}",
266
+ timeout=self.nmbrs.timeout
261
267
  )
262
268
  return resp
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-nmbrs
3
- Version: 1.3.0
3
+ Version: 1.3.2
4
4
  Summary: Nmbrs wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -2,7 +2,7 @@ from setuptools import setup, find_namespace_packages
2
2
 
3
3
  setup(
4
4
  name='brynq_sdk_nmbrs',
5
- version='1.3.0',
5
+ version='1.3.2',
6
6
  description='Nmbrs wrapper from BrynQ',
7
7
  long_description='Nmbrs wrapper from BrynQ',
8
8
  author='BrynQ',