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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq_sdk_factorial
3
- Version: 0.1.1
3
+ Version: 1.0.0
4
4
  Summary: Factorial wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.0
2
2
  Name: brynq-sdk-factorial
3
- Version: 0.1.1
3
+ Version: 1.0.0
4
4
  Summary: Factorial wrapper from BrynQ
5
5
  Home-page: UNKNOWN
6
6
  Author: BrynQ
@@ -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
@@ -1,2 +1,2 @@
1
- brynq-sdk-brynq>=1
1
+ brynq-sdk-brynq>=2
2
2
  pandas<3.0.0,>=2.2.0
@@ -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.1.1',
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=["brynq_sdk.factorial"],
10
+ packages=find_namespace_packages(include=['brynq_sdk*']),
12
11
  license='BrynQ License',
13
12
  install_requires=[
14
- 'brynq-sdk-brynq>=1',
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,14 +0,0 @@
1
- import requests
2
- import pandas as pd
3
- import json
4
-
5
-
6
- class Ats:
7
-
8
- def __init__(self, headers, base_url):
9
- self.headers = headers
10
- self.base_url = base_url
11
-
12
- def get_data(self):
13
- pass
14
-
@@ -1,14 +0,0 @@
1
- import requests
2
- import pandas as pd
3
- import json
4
-
5
-
6
- class Core:
7
-
8
- def __init__(self, headers, base_url):
9
- self.headers = headers
10
- self.base_url = base_url
11
-
12
- def get_data(self):
13
- pass
14
-
@@ -1,14 +0,0 @@
1
- import requests
2
- import pandas as pd
3
- import json
4
-
5
-
6
- class Finance:
7
-
8
- def __init__(self, headers, base_url):
9
- self.headers = headers
10
- self.base_url = base_url
11
-
12
- def get_data(self):
13
- pass
14
-
@@ -1,14 +0,0 @@
1
- import requests
2
- import pandas as pd
3
- import json
4
-
5
-
6
- class Payroll:
7
-
8
- def __init__(self, headers, base_url):
9
- self.headers = headers
10
- self.base_url = base_url
11
-
12
- def get_data(self):
13
- pass
14
-
@@ -1,14 +0,0 @@
1
- import requests
2
- import pandas as pd
3
- import json
4
-
5
-
6
- class Time:
7
-
8
- def __init__(self, headers, base_url):
9
- self.headers = headers
10
- self.base_url = base_url
11
-
12
- def get_data(self):
13
- pass
14
-