scorb-api 0.1.2__tar.gz → 0.1.4__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.
- {scorb_api-0.1.2 → scorb_api-0.1.4}/PKG-INFO +3 -3
- {scorb_api-0.1.2 → scorb_api-0.1.4}/pyproject.toml +1 -1
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/__init__.py +4 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoint.py +2 -6
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/__init__.py +9 -1
- scorb_api-0.1.4/scorb_api/models/endpoints/endpoint_customizado.py +95 -0
- scorb_api-0.1.4/scorb_api/models/endpoints/inventarios/__init__.py +46 -0
- scorb_api-0.1.4/scorb_api/models/endpoints/task_request.py +19 -0
- scorb_api-0.1.2/scorb_api/models/endpoints/endpoint_customizado.py +0 -10
- {scorb_api-0.1.2 → scorb_api-0.1.4}/LICENSE +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/README.md +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/helpers/http.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/authorization.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_customizadas/__init__.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/__init__.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/alert_definition.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/cenario_visao.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/centro_custo.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/centro_custo_verba_valor_real.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/check_caderias_total.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/check_caderias_total_por_verba.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/consulta_cadeira_fixo.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/consulta_centro_de_custo_fixo_new.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/consulta_centro_de_custo_fixo_old.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/conta_contabil.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/cotacao.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/expressao_customizada.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/faixa_salarial_esquema.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/funcao_customizada.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/funcionario.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/funcionario_alocacao.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/funcionario_salario_previsto.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/grupo_centro_custo.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/moeda.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/plano_contas.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/posicao.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/reajuste_alcance_motivo.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/report_calculated_field.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/verba.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/verba_centro_custo_depara.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/verba_reajuste_conta_contabil.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/__init__.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/alcance_tipo.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/atributo_customizado.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/cenario.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/cenario_campo.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/cenario_categoria.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/inventario_template.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/projector_template.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/resumo_hc_e_salario_cc_e_empresa.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/tabela_customizada.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/validation_configuration.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/tabelas_customizadas/__init__.py +0 -0
- {scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/utils/filter_clean_utils.py +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: scorb-api
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Scorb API Client to execute READ methods on API
|
|
5
|
-
Home-page: https://github.com/people-analytics-tech/scorb-api
|
|
6
5
|
License: MIT
|
|
7
6
|
Author: stone_people_analytics
|
|
8
7
|
Author-email: systems-techpeople@stone.com.br
|
|
@@ -15,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
18
|
Requires-Dist: aiodns (>=3.1.1,<4.0.0)
|
|
19
19
|
Requires-Dist: aiohttp (>=3.9.3,<4.0.0)
|
|
20
20
|
Requires-Dist: python-decouple (>=3.8,<4.0)
|
|
@@ -3,6 +3,7 @@ from scorb_api.models.endpoints import Globais
|
|
|
3
3
|
from scorb_api.models.endpoints import EntidadesDeCenario
|
|
4
4
|
from scorb_api.models.endpoints import TabelasCustomizadas
|
|
5
5
|
from scorb_api.models.endpoints import EntidadesCustomizadas
|
|
6
|
+
from scorb_api.models.endpoints import Inventario
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
"""This module provides the main client class for the Scorb API."""
|
|
@@ -30,6 +31,9 @@ class ScorbApiClient:
|
|
|
30
31
|
|
|
31
32
|
def tabelas_customizadas(self)-> TabelasCustomizadas:
|
|
32
33
|
return TabelasCustomizadas(self.header_auth)
|
|
34
|
+
|
|
35
|
+
def inventarios(self) -> Inventario:
|
|
36
|
+
return Inventario(self.header_auth)
|
|
33
37
|
|
|
34
38
|
__doc__ = """
|
|
35
39
|
**ScorbApiClient** is a python package to providing
|
|
@@ -32,6 +32,7 @@ from scorb_api.models.endpoints.entidade_de_cenario import(
|
|
|
32
32
|
VerbaReajusteContaContabil,
|
|
33
33
|
)
|
|
34
34
|
from scorb_api.models.endpoints.tabelas_customizadas import TabelaCustomizada
|
|
35
|
+
from scorb_api.models.endpoints.inventarios import Inventarios
|
|
35
36
|
|
|
36
37
|
class Globais():
|
|
37
38
|
def __init__(self, header_auth) -> None:
|
|
@@ -162,4 +163,11 @@ class TabelasCustomizadas():
|
|
|
162
163
|
self.header_auth = header_auth
|
|
163
164
|
|
|
164
165
|
def tabela_customizada(self, cenario_code, custom):
|
|
165
|
-
return TabelaCustomizada(header_auth=self.header_auth, cenario_code=cenario_code, custom=custom)
|
|
166
|
+
return TabelaCustomizada(header_auth=self.header_auth, cenario_code=cenario_code, custom=custom)
|
|
167
|
+
|
|
168
|
+
class Inventario():
|
|
169
|
+
def __init__(self, header_auth) -> None:
|
|
170
|
+
self.header_auth = header_auth
|
|
171
|
+
|
|
172
|
+
def inventario(self, cenario_code, model) -> Inventarios:
|
|
173
|
+
return Inventarios(header_auth=self.header_auth, cenario_code=cenario_code, model=model)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from scorb_api.models.endpoint import Endpoint
|
|
2
|
+
from typing import Union
|
|
3
|
+
import asyncio
|
|
4
|
+
|
|
5
|
+
from scorb_api.models.endpoints.task_request import TaskRequest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class EndpointCustomizado(Endpoint):
|
|
9
|
+
def __init__(self, header_auth, cenario_code, custom) -> None:
|
|
10
|
+
super().__init__(header_auth=header_auth)
|
|
11
|
+
self.base_url = f"/api/SCORC/crud/cenario/{cenario_code}/{custom}"
|
|
12
|
+
|
|
13
|
+
def read(self):
|
|
14
|
+
return asyncio.run(
|
|
15
|
+
self.http_request.request(
|
|
16
|
+
f"{self.base_url}/read", "post",
|
|
17
|
+
headers=self.header_auth
|
|
18
|
+
)
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def upsert(self, body: Union[dict, list[dict]]) -> TaskRequest:
|
|
22
|
+
"""Method to create or update record in custom entity.
|
|
23
|
+
|
|
24
|
+
To use this method, you need the following permissions:
|
|
25
|
+
- Required permission: "Entidade Customizada - Lista"
|
|
26
|
+
- Action: Upsert
|
|
27
|
+
- Action required: Edit
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
body (Union[dict, list[dict]], mandatory): Body object to send on request
|
|
31
|
+
|
|
32
|
+
Examples:
|
|
33
|
+
```python
|
|
34
|
+
from scorb_api import ScorbApiClient
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
client = ScorbApiClient(company="Company Name", app_name="app_name")
|
|
38
|
+
result = (
|
|
39
|
+
client.entidades_customizadas()
|
|
40
|
+
.entidade_customizada(cenario_code="code", custom="custom entity name")
|
|
41
|
+
.upsert(body={"field_1": "value", "field_2": "value"})
|
|
42
|
+
)
|
|
43
|
+
```
|
|
44
|
+
"""
|
|
45
|
+
result = asyncio.run(
|
|
46
|
+
self.http_request.request(
|
|
47
|
+
f"{self.base_url}/upsert", "post",
|
|
48
|
+
headers=self.header_auth,
|
|
49
|
+
json=body
|
|
50
|
+
)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
return TaskRequest(
|
|
54
|
+
header_auth=self.header_auth,
|
|
55
|
+
token=result.get("token"),
|
|
56
|
+
result=result.get("result")
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def update(self, body: Union[dict, list[dict]]) -> TaskRequest:
|
|
60
|
+
"""Method to update existing record in custom entity.
|
|
61
|
+
|
|
62
|
+
To use this method, you need the following permissions:
|
|
63
|
+
- Required permission: "Entidade Customizada - Lista"
|
|
64
|
+
- Action: Update
|
|
65
|
+
- Action required: Edit
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
body (Union[dict, list[dict]], mandatory): Body object to send on request
|
|
69
|
+
|
|
70
|
+
Examples:
|
|
71
|
+
```python
|
|
72
|
+
from scorb_api import ScorbApiClient
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
client = ScorbApiClient(company="Company Name", app_name="app_name")
|
|
76
|
+
result = (
|
|
77
|
+
client.entidades_customizadas()
|
|
78
|
+
.entidade_customizada(cenario_code="code", custom="custom entity name")
|
|
79
|
+
.update(body={"field_1": "value", "field_2": "value"})
|
|
80
|
+
)
|
|
81
|
+
```
|
|
82
|
+
"""
|
|
83
|
+
result = asyncio.run(
|
|
84
|
+
self.http_request.request(
|
|
85
|
+
f"{self.base_url}/update", "post",
|
|
86
|
+
headers=self.header_auth,
|
|
87
|
+
json=body
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return TaskRequest(
|
|
92
|
+
header_auth=self.header_auth,
|
|
93
|
+
token=result.get("token"),
|
|
94
|
+
result=result.get("result")
|
|
95
|
+
)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from scorb_api.models.endpoint import Endpoint
|
|
2
|
+
from typing import Union
|
|
3
|
+
import asyncio
|
|
4
|
+
from scorb_api.models.endpoints.task_request import TaskRequest
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Inventarios(Endpoint):
|
|
8
|
+
def __init__(self, header_auth, cenario_code: str, model: str) -> None:
|
|
9
|
+
super().__init__(header_auth=header_auth)
|
|
10
|
+
self.base_url = f"/api/SCORC/inventory/cenario/{cenario_code}/{model}"
|
|
11
|
+
|
|
12
|
+
def load(self, body: Union[dict, list[dict]]):
|
|
13
|
+
"""Method to bulk load records to inventory model
|
|
14
|
+
|
|
15
|
+
To use this method, you need the following permissions:
|
|
16
|
+
- Required permission: "Carga de Dados"
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
body (Union[dict, list[dict]], mandatory): Body object to send on request
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
```python
|
|
23
|
+
from scorb_api import ScorbApiClient
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
client = ScorbApiClient(company="Company Name", app_name="app_name")
|
|
27
|
+
result = (
|
|
28
|
+
client.inventarios()
|
|
29
|
+
.inventario(cenario_code="code", model="inventory model name")
|
|
30
|
+
.load(body={"field_1": "value", "field_2": "value"})
|
|
31
|
+
)
|
|
32
|
+
```
|
|
33
|
+
"""
|
|
34
|
+
result = asyncio.run(
|
|
35
|
+
self.http_request.request(
|
|
36
|
+
self.base_url, "post",
|
|
37
|
+
headers=self.header_auth,
|
|
38
|
+
json=body
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return TaskRequest(
|
|
43
|
+
header_auth=self.header_auth,
|
|
44
|
+
token=result.get("token"),
|
|
45
|
+
result=result.get("result")
|
|
46
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from scorb_api.models.endpoint import Endpoint
|
|
2
|
+
import asyncio
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class TaskRequest(Endpoint):
|
|
6
|
+
def __init__(self, header_auth, token: str, result: str = None) -> None:
|
|
7
|
+
super().__init__(header_auth)
|
|
8
|
+
self.result = result
|
|
9
|
+
self.token = token
|
|
10
|
+
self.base_url = f"/api/request/{self.token}"
|
|
11
|
+
|
|
12
|
+
def status(self) -> dict:
|
|
13
|
+
return asyncio.run(
|
|
14
|
+
self.http_request.request(
|
|
15
|
+
endpoint=self.base_url,
|
|
16
|
+
method="post",
|
|
17
|
+
headers=self.header_auth
|
|
18
|
+
)
|
|
19
|
+
)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
from scorb_api.models.endpoint import Endpoint
|
|
2
|
-
import asyncio
|
|
3
|
-
|
|
4
|
-
class EndpointCustomizado(Endpoint):
|
|
5
|
-
def __init__(self, header_auth, cenario_code, custom) -> None:
|
|
6
|
-
super().__init__(header_auth=header_auth)
|
|
7
|
-
self.base_url = f"/api/SCORC/crud/cenario/{cenario_code}/{custom}"
|
|
8
|
-
|
|
9
|
-
def read(self):
|
|
10
|
-
return asyncio.run(self.http_request.request(f"{self.base_url}/read", "post", headers=self.header_auth))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_customizadas/__init__.py
RENAMED
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/cenario_visao.py
RENAMED
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/centro_custo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/conta_contabil.py
RENAMED
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/cotacao.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/funcionario.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/plano_contas.py
RENAMED
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/entidade_de_cenario/posicao.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
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/atributo_customizado.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/inventario_template.py
RENAMED
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/projector_template.py
RENAMED
|
File without changes
|
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/tabela_customizada.py
RENAMED
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/globais/validation_configuration.py
RENAMED
|
File without changes
|
{scorb_api-0.1.2 → scorb_api-0.1.4}/scorb_api/models/endpoints/tabelas_customizadas/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|