brynq-sdk-factorial 2.1.0__tar.gz → 2.3.0__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.
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/PKG-INFO +1 -1
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/__init__.py +4 -4
- brynq_sdk_factorial-2.3.0/brynq_sdk_factorial/family_situation.py +50 -0
- brynq_sdk_factorial-2.3.0/brynq_sdk_factorial/schemas/family_situation.py +33 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/PKG-INFO +1 -1
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/SOURCES.txt +2 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/setup.py +1 -1
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/companies.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/compensations.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/contracts.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/costcenter.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/custom_fields.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/employees.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/files.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/locations.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/payroll.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/attendance_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/banking_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/companies_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/contracts_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/documents_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/employee_updates_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/employees_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/expenses_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/finance_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/holidays_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/job_catalog_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/locations_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/payroll_employees_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/payroll_integrations_base_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/payroll_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/project_management_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/shift_management_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/teams_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/time_planning_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/time_settings_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/timeoff_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/trainings_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/work_schedule_schemas.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/teams.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/workschedules.py +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/dependency_links.txt +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/not-zip-safe +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/requires.txt +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/top_level.txt +0 -0
- {brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/setup.cfg +0 -0
|
@@ -11,7 +11,7 @@ from .locations import Locations
|
|
|
11
11
|
from .payroll import Payroll
|
|
12
12
|
from .teams import Teams
|
|
13
13
|
from .workschedules import Workschedules
|
|
14
|
-
|
|
14
|
+
from .family_situation import FamilySituation
|
|
15
15
|
|
|
16
16
|
# Set the base class for Factorial. This class will be used to set the credentials and those will be used in all other classes.
|
|
17
17
|
class Factorial(BrynQ):
|
|
@@ -22,10 +22,10 @@ class Factorial(BrynQ):
|
|
|
22
22
|
super().__init__()
|
|
23
23
|
self.timeout = 3600
|
|
24
24
|
if demo:
|
|
25
|
-
self.base_url = 'https://api.demo.factorial.dev/api/
|
|
25
|
+
self.base_url = 'https://api.demo.factorial.dev/api/2025-07-01/'
|
|
26
26
|
self.base_url_v1 = 'https://api.demo.factorial.dev/api/v1/'
|
|
27
27
|
else:
|
|
28
|
-
self.base_url = 'https://api.factorialhr.com/api/
|
|
28
|
+
self.base_url = 'https://api.factorialhr.com/api/2025-07-01/'
|
|
29
29
|
self.base_url_v1 = 'https://api.factorialhr.com/api/v1/'
|
|
30
30
|
headers = self._get_credentials(system_type)
|
|
31
31
|
self.session = requests.Session()
|
|
@@ -40,6 +40,7 @@ class Factorial(BrynQ):
|
|
|
40
40
|
self.payroll = Payroll(self)
|
|
41
41
|
self.workschedules = Workschedules(self)
|
|
42
42
|
self.files = Files(self)
|
|
43
|
+
self.family_situation = FamilySituation(self)
|
|
43
44
|
self.debug = debug
|
|
44
45
|
|
|
45
46
|
def _get_credentials(self, system_type):
|
|
@@ -57,4 +58,3 @@ class Factorial(BrynQ):
|
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
return headers
|
|
60
|
-
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
import pandas as pd
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class FamilySituation:
|
|
6
|
+
def __init__(self, factorial):
|
|
7
|
+
self.factorial = factorial
|
|
8
|
+
self.base_endpoint = '/resources/payroll/family_situations'
|
|
9
|
+
|
|
10
|
+
def get(self,
|
|
11
|
+
employee_ids: list[int] = None) -> pd.DataFrame:
|
|
12
|
+
|
|
13
|
+
# Use locals() to get all function parameters as a dictionary. Do not move this down since it will include all variables in function scope
|
|
14
|
+
func_params = list(locals().items())
|
|
15
|
+
params = {}
|
|
16
|
+
for param, value in func_params:
|
|
17
|
+
if param != 'self' and value is not None:
|
|
18
|
+
params[param] = value
|
|
19
|
+
|
|
20
|
+
has_next_page = True
|
|
21
|
+
result_data = pd.DataFrame()
|
|
22
|
+
while has_next_page:
|
|
23
|
+
response = self.factorial.session.get(url=f'{self.factorial.base_url}{self.base_endpoint}',
|
|
24
|
+
params=params,
|
|
25
|
+
timeout=self.factorial.timeout)
|
|
26
|
+
response.raise_for_status()
|
|
27
|
+
response_data = response.json()
|
|
28
|
+
result_data = pd.concat([result_data, pd.DataFrame(response_data['data'])])
|
|
29
|
+
has_next_page = response_data['meta']['has_next_page']
|
|
30
|
+
if has_next_page:
|
|
31
|
+
params['after_id'] = response_data['meta']['end_cursor']
|
|
32
|
+
|
|
33
|
+
return result_data
|
|
34
|
+
|
|
35
|
+
def create(self, data: dict) -> requests.Response:
|
|
36
|
+
response = self.factorial.session.post(url=f'{self.factorial.base_url}{self.base_endpoint}',
|
|
37
|
+
json=data,
|
|
38
|
+
timeout=self.factorial.timeout)
|
|
39
|
+
response.raise_for_status()
|
|
40
|
+
return response
|
|
41
|
+
|
|
42
|
+
def update(self, family_situation_id: str, data: dict) -> requests.Response:
|
|
43
|
+
response = self.factorial.session.put(url=f'{self.factorial.base_url}{self.base_endpoint}/{family_situation_id}',
|
|
44
|
+
json=data,
|
|
45
|
+
timeout=self.factorial.timeout)
|
|
46
|
+
response.raise_for_status()
|
|
47
|
+
return response
|
|
48
|
+
|
|
49
|
+
def delete(self, family_situation_id: str) -> requests.Response:
|
|
50
|
+
raise NotImplementedError
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Auto-generated schemas for category: family_situation
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
import pandera as pa
|
|
5
|
+
from pandera.typing import Series, String, Int, Float, Bool, DateTime
|
|
6
|
+
import pandera.extensions as extensions
|
|
7
|
+
from brynq_sdk_functions import BrynQPanderaDataFrameModel
|
|
8
|
+
from typing import Optional, Annotated
|
|
9
|
+
from pydantic import BaseModel, Field, StringConstraints
|
|
10
|
+
|
|
11
|
+
class Family_situationGet(BrynQPanderaDataFrameModel):
|
|
12
|
+
id: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=False, description="ID of the family situation.", alias="id")
|
|
13
|
+
employee_id: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=False, description="Employee id of the family situation.", alias="employee_id")
|
|
14
|
+
civil_status: Series[String] = pa.Field(coerce=True, nullable=True, description="Civil status of the employee.", alias="civil_status")
|
|
15
|
+
number_of_dependants: Series[pd.Int64Dtype] = pa.Field(coerce=True, nullable=True, description="Number of dependants of the employee.", alias="number_of_dependants")
|
|
16
|
+
|
|
17
|
+
class _Annotation:
|
|
18
|
+
primary_key = "id"
|
|
19
|
+
foreign_keys = {
|
|
20
|
+
"employee_id": {
|
|
21
|
+
"parent_schema": "EmployeesGet",
|
|
22
|
+
"parent_column": "id",
|
|
23
|
+
"cardinality": "N:1"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class Family_situationCreate(BaseModel):
|
|
28
|
+
employee_id: int = Field(..., description="Employee id.", alias="employee_id")
|
|
29
|
+
civil_status: Optional[Annotated[str, StringConstraints(pattern=r'^single|cohabitating|divorced|married|unknown|civil_partnership|separated|widow|not_applicable$', strip_whitespace=True)]] = Field(None, description="Civil status of the employee.", alias="civil_status")
|
|
30
|
+
number_of_dependants: Optional[int] = Field(None, description="Number of dependants of the employee.", alias="number_of_dependants")
|
|
31
|
+
|
|
32
|
+
class Family_situationDelete(BaseModel):
|
|
33
|
+
id: int = Field(..., description="ID", alias="id")
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/SOURCES.txt
RENAMED
|
@@ -6,6 +6,7 @@ brynq_sdk_factorial/contracts.py
|
|
|
6
6
|
brynq_sdk_factorial/costcenter.py
|
|
7
7
|
brynq_sdk_factorial/custom_fields.py
|
|
8
8
|
brynq_sdk_factorial/employees.py
|
|
9
|
+
brynq_sdk_factorial/family_situation.py
|
|
9
10
|
brynq_sdk_factorial/files.py
|
|
10
11
|
brynq_sdk_factorial/locations.py
|
|
11
12
|
brynq_sdk_factorial/payroll.py
|
|
@@ -25,6 +26,7 @@ brynq_sdk_factorial/schemas/documents_schemas.py
|
|
|
25
26
|
brynq_sdk_factorial/schemas/employee_updates_schemas.py
|
|
26
27
|
brynq_sdk_factorial/schemas/employees_schemas.py
|
|
27
28
|
brynq_sdk_factorial/schemas/expenses_schemas.py
|
|
29
|
+
brynq_sdk_factorial/schemas/family_situation.py
|
|
28
30
|
brynq_sdk_factorial/schemas/finance_schemas.py
|
|
29
31
|
brynq_sdk_factorial/schemas/holidays_schemas.py
|
|
30
32
|
brynq_sdk_factorial/schemas/job_catalog_schemas.py
|
|
File without changes
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/compensations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/custom_fields.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/schemas/teams_schemas.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial/workschedules.py
RENAMED
|
File without changes
|
|
File without changes
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/requires.txt
RENAMED
|
File without changes
|
{brynq_sdk_factorial-2.1.0 → brynq_sdk_factorial-2.3.0}/brynq_sdk_factorial.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|