csc-cia-stne 0.0.58__tar.gz → 0.0.59__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.
Files changed (38) hide show
  1. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/PKG-INFO +1 -1
  2. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/pyproject.toml +1 -1
  3. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/google_drive.py +28 -7
  4. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne.egg-info/PKG-INFO +1 -1
  5. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/LICENCE +0 -0
  6. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/README.md +0 -0
  7. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/README_PYPI.md +0 -0
  8. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/setup.cfg +0 -0
  9. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/__init__.py +0 -0
  10. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/bc_correios.py +0 -0
  11. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/bc_sta.py +0 -0
  12. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/email.py +0 -0
  13. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/gcp_bigquery.py +0 -0
  14. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/karavela.py +0 -0
  15. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/logger_json.py +0 -0
  16. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/logger_rich.py +0 -0
  17. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/provio.py +0 -0
  18. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/servicenow.py +0 -0
  19. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/slack.py +0 -0
  20. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/stne_admin.py +0 -0
  21. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/__init__.py +0 -0
  22. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/functions/__init__.py +0 -0
  23. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/functions/func_b64.py +0 -0
  24. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/functions/func_converters.py +0 -0
  25. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/functions/func_get_secret.py +0 -0
  26. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/functions/func_recriar_pastas.py +0 -0
  27. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/functions/func_settings.py +0 -0
  28. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/functions/func_titulo.py +0 -0
  29. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/validations/GcpBigQueryValidator.py +0 -0
  30. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/validations/GoogleDriveValidator.py +0 -0
  31. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/validations/ServiceNowValidator.py +0 -0
  32. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/validations/__init__.py +0 -0
  33. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/utilitarios/validations/web_validator.py +0 -0
  34. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne/web.py +0 -0
  35. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne.egg-info/SOURCES.txt +0 -0
  36. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne.egg-info/dependency_links.txt +0 -0
  37. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne.egg-info/requires.txt +0 -0
  38. {csc_cia_stne-0.0.58 → csc_cia_stne-0.0.59}/src/csc_cia_stne.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: csc_cia_stne
3
- Version: 0.0.58
3
+ Version: 0.0.59
4
4
  Summary: Biblioteca do time CSC-CIA utilizada no desenvolvimento de RPAs
5
5
  License: MIT
6
6
  Keywords: karavela,csc,cia,stone,rpa,botcity,stne
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "csc_cia_stne"
7
- version = "0.0.58"
7
+ version = "0.0.59"
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", "botcity", "stne"]
@@ -227,7 +227,7 @@ class GoogleDrive():
227
227
  logging.error(f"Ocorreu um erro ao fazer a requisição. Error: {e}")
228
228
 
229
229
 
230
- def get_file(self, file : str, ):
230
+ def download_file(self, file : str, mimeType : str):
231
231
  """
232
232
  Obtém o conteúdo de um arquivo armazenado no Google Drive.
233
233
 
@@ -253,16 +253,37 @@ class GoogleDrive():
253
253
  - A função assume a existência de um atributo `self.service` configurado para interagir com a API do Google Drive.
254
254
  """
255
255
  try:
256
- logging.debug(f"Lendo o arquivo {file.get('name')}")
257
- request = self.service.files().get_media(fileId=file.get("id"))
258
- file_data = BytesIO(request.execute())
259
- logging.debug("Leitura do arquivo finalizada")
260
-
261
- return {"success" : True, "result" : file_data}
256
+ request = self.service.files().export_media(fileId=file.get("id"), mimeType=mimeType)
257
+ with open (file["name"], "wb") as f:
258
+ f.write(request.execute())
259
+ return {"success" : True, "result" : f"Arquivo baixado com sucesso. Diretório: {file}"}
262
260
 
263
261
  except Exception as e:
264
262
  logging.debug(f"Erro ao tentar abrir o arquivo. Erro {e}")
265
263
  return {"success" : False, "result" : None}
264
+
266
265
 
266
+ def get_base_data(self, id_sheet:str,page:str) -> list:
267
+ """
268
+ Retorna os dados da planilha especificada.
269
+ Parâmetros:
270
+ - drive_client: Cliente do Google Drive.
271
+ - id_sheet: ID da planilha.
272
+ - page: Nome da página da planilha.
273
+ Retorna:
274
+ - Uma lista contendo os valores da planilha.
275
+ Exemplo de uso:
276
+ >>> drive_client = ...
277
+ >>> id_sheet = "abc123"
278
+ >>> page = "Sheet1"
279
+ >>> data = get_base_data(drive_client, id_sheet, page)
280
+ """
281
+ try:
282
+ sheet = self.service.spreadsheets()
283
+ result = sheet.values().get(spreadsheetId=id_sheet, range=page).execute()
284
+ values = result.get('values', [])
285
+ return {"success" : True, "result" : values}
286
+ except Exception as e:
287
+ return {"success" : False, "result" : None, "error" : str(e)}
267
288
 
268
289
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: csc_cia_stne
3
- Version: 0.0.58
3
+ Version: 0.0.59
4
4
  Summary: Biblioteca do time CSC-CIA utilizada no desenvolvimento de RPAs
5
5
  License: MIT
6
6
  Keywords: karavela,csc,cia,stone,rpa,botcity,stne
File without changes
File without changes
File without changes