brynq-sdk-factorial 0.1.1__tar.gz → 1.0.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-0.1.1 → brynq_sdk_factorial-1.0.0}/PKG-INFO +1 -1
- {brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/PKG-INFO +1 -1
- {brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/SOURCES.txt +0 -6
- {brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/requires.txt +1 -1
- brynq_sdk_factorial-1.0.0/brynq_sdk_factorial.egg-info/top_level.txt +1 -0
- {brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/setup.py +4 -5
- brynq_sdk_factorial-0.1.1/brynq_sdk/factorial/__init__.py +0 -55
- brynq_sdk_factorial-0.1.1/brynq_sdk/factorial/ats.py +0 -14
- brynq_sdk_factorial-0.1.1/brynq_sdk/factorial/core.py +0 -14
- brynq_sdk_factorial-0.1.1/brynq_sdk/factorial/finance.py +0 -14
- brynq_sdk_factorial-0.1.1/brynq_sdk/factorial/payroll.py +0 -14
- brynq_sdk_factorial-0.1.1/brynq_sdk/factorial/time.py +0 -14
- brynq_sdk_factorial-0.1.1/brynq_sdk_factorial.egg-info/top_level.txt +0 -1
- {brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/dependency_links.txt +0 -0
- {brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/not-zip-safe +0 -0
- {brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/setup.cfg +0 -0
{brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/SOURCES.txt
RENAMED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
setup.py
|
|
2
|
-
brynq_sdk/factorial/__init__.py
|
|
3
|
-
brynq_sdk/factorial/ats.py
|
|
4
|
-
brynq_sdk/factorial/core.py
|
|
5
|
-
brynq_sdk/factorial/finance.py
|
|
6
|
-
brynq_sdk/factorial/payroll.py
|
|
7
|
-
brynq_sdk/factorial/time.py
|
|
8
2
|
brynq_sdk_factorial.egg-info/PKG-INFO
|
|
9
3
|
brynq_sdk_factorial.egg-info/SOURCES.txt
|
|
10
4
|
brynq_sdk_factorial.egg-info/dependency_links.txt
|
{brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/requires.txt
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
brynq-sdk-brynq>=
|
|
1
|
+
brynq-sdk-brynq>=2
|
|
2
2
|
pandas<3.0.0,>=2.2.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
from setuptools import setup
|
|
2
|
-
|
|
1
|
+
from setuptools import setup, find_namespace_packages
|
|
3
2
|
|
|
4
3
|
setup(
|
|
5
4
|
name='brynq_sdk_factorial',
|
|
6
|
-
version='0.
|
|
5
|
+
version='1.0.0',
|
|
7
6
|
description='Factorial wrapper from BrynQ',
|
|
8
7
|
long_description='Factorial wrapper from BrynQ',
|
|
9
8
|
author='BrynQ',
|
|
10
9
|
author_email='support@brynq.com',
|
|
11
|
-
packages=[
|
|
10
|
+
packages=find_namespace_packages(include=['brynq_sdk*']),
|
|
12
11
|
license='BrynQ License',
|
|
13
12
|
install_requires=[
|
|
14
|
-
'brynq-sdk-brynq>=
|
|
13
|
+
'brynq-sdk-brynq>=2',
|
|
15
14
|
'pandas>=2.2.0,<3.0.0',
|
|
16
15
|
],
|
|
17
16
|
zip_safe=False,
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import requests
|
|
2
|
-
import json
|
|
3
|
-
from typing import List, Union
|
|
4
|
-
from brynq_sdk.brynq import BrynQ
|
|
5
|
-
from brynq_sdk.factorial.ats import Ats
|
|
6
|
-
from brynq_sdk.factorial.core import Core
|
|
7
|
-
from brynq_sdk.factorial.finance import Finance
|
|
8
|
-
from brynq_sdk.factorial.payroll import Payroll
|
|
9
|
-
from brynq_sdk.factorial.time import Time
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# Set the base class for Factorial. This class will be used to set the credentials and those will be used in all other classes.
|
|
13
|
-
class Factorial(BrynQ):
|
|
14
|
-
def __init__(self, label: Union[str, List], debug: bool = False):
|
|
15
|
-
""""
|
|
16
|
-
For the documentation of Factorial, see: https://apidoc.factorialhr.com/docs/authentication-1
|
|
17
|
-
"""
|
|
18
|
-
super().__init__()
|
|
19
|
-
base_url = 'https://api.factorialhr.com/api/v1/'
|
|
20
|
-
headers = self._get_credentials(label, base_url)
|
|
21
|
-
self.ats = Ats(headers, base_url)
|
|
22
|
-
self.core = Core(headers, base_url)
|
|
23
|
-
self.finance = Finance(headers, base_url)
|
|
24
|
-
self.payroll = Payroll(headers, base_url)
|
|
25
|
-
self.time = Time(headers, base_url)
|
|
26
|
-
|
|
27
|
-
def _get_credentials(self, label, base_url):
|
|
28
|
-
"""
|
|
29
|
-
Sets the credentials for the SuccessFactors API.
|
|
30
|
-
:param label (str): The label for the system credentials.
|
|
31
|
-
:returns: headers (dict): The headers for the API request, including the access token.
|
|
32
|
-
"""
|
|
33
|
-
credentials = self.get_system_credential(system='factorial', label=label)
|
|
34
|
-
payload = {
|
|
35
|
-
"client_id": f"{credentials['client_id']}",
|
|
36
|
-
"client_secret": f"{credentials['client_secret']}",
|
|
37
|
-
"grant_type": "client_credentials"
|
|
38
|
-
}
|
|
39
|
-
headers = {
|
|
40
|
-
"accept": "application/json",
|
|
41
|
-
"content-type": "application/x-www-form-urlencoded"
|
|
42
|
-
}
|
|
43
|
-
url = f'{base_url}/auth/token'
|
|
44
|
-
payload = json.dumps(payload)
|
|
45
|
-
response = requests.post(url, headers=headers, data=payload)
|
|
46
|
-
response.raise_for_status()
|
|
47
|
-
access_token = response.json()['access_token']
|
|
48
|
-
|
|
49
|
-
headers = {
|
|
50
|
-
'Authorization': f'Bearer {access_token}',
|
|
51
|
-
'Content-Type': 'application/json'
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return headers
|
|
55
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
brynq_sdk
|
|
File without changes
|
{brynq_sdk_factorial-0.1.1 → brynq_sdk_factorial-1.0.0}/brynq_sdk_factorial.egg-info/not-zip-safe
RENAMED
|
File without changes
|
|
File without changes
|