csc-cia-stne 0.0.43__tar.gz → 0.0.45__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/PKG-INFO +1 -1
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/pyproject.toml +1 -1
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/__init__.py +4 -4
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/logger_json.py +4 -4
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/logger_rich.py +2 -2
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/provio.py +3 -1
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne.egg-info/PKG-INFO +1 -1
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/LICENCE +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/README.md +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/README_PYPI.md +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/setup.cfg +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/bc_correios.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/bc_sta.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/email.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/gcp_bigquery.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/google_drive.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/karavela.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/servicenow.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/slack.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/stne_admin.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/__init__.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/__init__.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_b64.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_converters.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_recriar_pastas.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_settings.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_titulo.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/validations/GcpBigQueryValidator.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/validations/GoogleDriveValidator.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/validations/ServiceNowValidator.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/validations/__init__.py +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne.egg-info/SOURCES.txt +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne.egg-info/dependency_links.txt +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne.egg-info/requires.txt +0 -0
- {csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "csc_cia_stne"
|
7
|
-
version = "0.0.
|
7
|
+
version = "0.0.45"
|
8
8
|
license = { text = "MIT" }
|
9
9
|
description = "Biblioteca do time CSC-CIA utilizada no desenvolvimento de RPAs"
|
10
10
|
keywords = ["karavela", "csc", "cia", "stone", "rpa"]
|
@@ -62,7 +62,7 @@ def _running_in_container():
|
|
62
62
|
|
63
63
|
return False
|
64
64
|
|
65
|
-
def logger():
|
65
|
+
def logger(nome:str='__main__'):
|
66
66
|
"""
|
67
67
|
Retorna um objeto logger com base no ambiente de execução.
|
68
68
|
Se a variável de ambiente 'ambiente_de_execucao' estiver definida e for igual a "karavela",
|
@@ -78,12 +78,12 @@ def logger():
|
|
78
78
|
|
79
79
|
if os.getenv('ambiente_de_execucao') is not None and os.getenv('ambiente_de_execucao') == "karavela":
|
80
80
|
|
81
|
-
return get_logger_json()
|
81
|
+
return get_logger_json(nome)
|
82
82
|
|
83
83
|
elif _running_in_container():
|
84
84
|
|
85
|
-
return get_logger_json()
|
85
|
+
return get_logger_json(nome)
|
86
86
|
|
87
87
|
else:
|
88
88
|
|
89
|
-
return get_logger_rich()
|
89
|
+
return get_logger_rich(nome)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import logging
|
2
2
|
from pythonjsonlogger import jsonlogger
|
3
3
|
|
4
|
-
def setup_json_logger():
|
4
|
+
def setup_json_logger(nome):
|
5
5
|
|
6
6
|
def add_log_level(level_name, level_num, method_name=None):
|
7
7
|
"""
|
@@ -45,7 +45,7 @@ def setup_json_logger():
|
|
45
45
|
|
46
46
|
if not 'SUCCESS' in logging._nameToLevel:
|
47
47
|
add_log_level("SUCCESS",21)
|
48
|
-
logger = logging.getLogger(
|
48
|
+
logger = logging.getLogger(nome)
|
49
49
|
logger.setLevel(logging.INFO)
|
50
50
|
|
51
51
|
# Remove handlers anteriores, se houver
|
@@ -78,7 +78,7 @@ def setup_json_logger():
|
|
78
78
|
# Chama a função para configurar o logger
|
79
79
|
#logger = setup_json_logger()
|
80
80
|
|
81
|
-
def get_logger():
|
81
|
+
def get_logger(nome):
|
82
82
|
"""
|
83
83
|
logger = logging.getLogger("my_json_logger")
|
84
84
|
if not logger.hasHandlers(): # Evita configurar múltiplas vezes
|
@@ -88,5 +88,5 @@ def get_logger():
|
|
88
88
|
logger.setLevel(logging.DEBUG)
|
89
89
|
logger.addHandler(handler)
|
90
90
|
"""
|
91
|
-
logger = setup_json_logger()
|
91
|
+
logger = setup_json_logger(nome)
|
92
92
|
return logger
|
@@ -115,7 +115,7 @@ logger = logging.getLogger()
|
|
115
115
|
|
116
116
|
"""
|
117
117
|
|
118
|
-
def get_logger():
|
118
|
+
def get_logger(nome):
|
119
119
|
"""
|
120
120
|
Retorna um objeto logger configurado com base nas variáveis de ambiente.
|
121
121
|
Returns:
|
@@ -238,7 +238,7 @@ def get_logger():
|
|
238
238
|
if not 'SUCCESS' in logging._nameToLevel:
|
239
239
|
add_log_level("SUCCESS",21)
|
240
240
|
|
241
|
-
logger = logging.getLogger(
|
241
|
+
logger = logging.getLogger(nome)
|
242
242
|
|
243
243
|
# Sendo setado aqui pois no basicConfig estava gerando logs para as libs do slack_sdk e big query
|
244
244
|
|
@@ -4,6 +4,8 @@ from requests.auth import HTTPBasicAuth
|
|
4
4
|
from pydantic import BaseModel, Field, ValidationError
|
5
5
|
from typing import List, Dict, Union
|
6
6
|
|
7
|
+
log = logging.getLogger('__main__')
|
8
|
+
|
7
9
|
# Validadores
|
8
10
|
class ProvioModel(BaseModel):
|
9
11
|
"""
|
@@ -90,7 +92,7 @@ class Provio:
|
|
90
92
|
skip += 500
|
91
93
|
requisicao += 1
|
92
94
|
if verbose:
|
93
|
-
|
95
|
+
log.info(f"Exportando relatório: Requisição #{str(requisicao).zfill(3)}: {len(todos_os_dados)} registros no total")
|
94
96
|
|
95
97
|
else:
|
96
98
|
|
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
|
{csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/__init__.py
RENAMED
File without changes
|
{csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_b64.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_settings.py
RENAMED
File without changes
|
{csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/functions/func_titulo.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{csc_cia_stne-0.0.43 → csc_cia_stne-0.0.45}/src/csc_cia_stne/utilitarios/validations/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|