DE-Lib 0.0.41__tar.gz → 0.0.42__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 (54) hide show
  1. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/Oracle.py +17 -8
  2. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/SQLite.py +4 -1
  3. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib.egg-info/PKG-INFO +1 -1
  4. {de_lib-0.0.41 → de_lib-0.0.42}/PKG-INFO +1 -1
  5. {de_lib-0.0.41 → de_lib-0.0.42}/setup.py +1 -1
  6. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Cloud/__init__.py +0 -0
  7. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/Azure.py +0 -0
  8. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/Cache.py +0 -0
  9. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/Firebird.py +0 -0
  10. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/Informix.py +0 -0
  11. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/Metadata.py +0 -0
  12. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/MsSql.py +0 -0
  13. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/MySql.py +0 -0
  14. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/OracleDDL.py +0 -0
  15. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/Postgres.py +0 -0
  16. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/RedShift.py +0 -0
  17. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/SQCipher.py +0 -0
  18. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/DataBase/__init__.py +0 -0
  19. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/Avro.py +0 -0
  20. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/Csv.py +0 -0
  21. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/JSon.py +0 -0
  22. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/Parquet.py +0 -0
  23. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/Txt.py +0 -0
  24. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/Xlsx.py +0 -0
  25. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/Zip.py +0 -0
  26. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Files/__init__.py +0 -0
  27. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Log/DE_LogEventos.py +0 -0
  28. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Log/Level.py +0 -0
  29. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Log/Log.py +0 -0
  30. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Log/__init__.py +0 -0
  31. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Aes.py +0 -0
  32. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Argon.py +0 -0
  33. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Base64.py +0 -0
  34. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Cipher.py +0 -0
  35. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Fernet.py +0 -0
  36. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Gcm.py +0 -0
  37. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Pbkdf2.py +0 -0
  38. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/Rsa.py +0 -0
  39. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Cipher/__init__.py +0 -0
  40. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Colors.py +0 -0
  41. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/DateUtils.py +0 -0
  42. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Generic.py +0 -0
  43. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/Sql.py +0 -0
  44. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/System.py +0 -0
  45. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/WebHook.py +0 -0
  46. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/Utils/__init__.py +0 -0
  47. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib/__init__.py +0 -0
  48. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib.egg-info/SOURCES.txt +0 -0
  49. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib.egg-info/dependency_links.txt +0 -0
  50. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib.egg-info/requires.txt +0 -0
  51. {de_lib-0.0.41 → de_lib-0.0.42}/DE_Lib.egg-info/top_level.txt +0 -0
  52. {de_lib-0.0.41 → de_lib-0.0.42}/LICENCE +0 -0
  53. {de_lib-0.0.41 → de_lib-0.0.42}/README.md +0 -0
  54. {de_lib-0.0.41 → de_lib-0.0.42}/setup.cfg +0 -0
@@ -2,6 +2,7 @@ import os
2
2
  import cx_Oracle as ora
3
3
  import oracledb as odb
4
4
  import sqlalchemy as sqa
5
+ from sqlalchemy import create_engine, text
5
6
  import json
6
7
 
7
8
  from DE_Lib.Utils import Generic
@@ -71,7 +72,8 @@ class ORACLE:
71
72
  __driver = conn["driver_library"].lower()
72
73
  conn_cnn = f"""{conn["database"].lower()}+{__driver}://{conn["username"]}:{conn["password"]}@{__dnsName}"""
73
74
  __engine = sqa.create_engine(conn_cnn)
74
- __conn = __engine.connect().connection
75
+ with __engine.connect() as connection:
76
+ __conn = connection.execute(text("select 1 from dual"))
75
77
  elif conn["driver_conexao"].upper() == "CX_ORACLE":
76
78
  __conn = ora.connect(conn["username"], conn["password"], __dnsName, threaded=True)
77
79
  elif conn["driver_conexao"].upper() == "ORACLEDB" or conn is None:
@@ -88,9 +90,12 @@ class ORACLE:
88
90
  #endregion
89
91
  except Exception as error:
90
92
  msg = f"""{json.dumps(conn, indent=4).replace(conn["password"], "******")}\nFalha ao tentar se conectar com o banco de dados ORACLE (SqlAlchemy)\nException Error: {error} """
91
- self._connection_is_valid = False
93
+ self.__cnn = msg
94
+ self.__connection_is_valid = False
92
95
  self.__database_error = msg
96
+ self.__database_driver = conn["driver_conexao"]
93
97
  result = self._connection_is_valid
98
+ self.__nome_database = gen.nvl(conn["database"], "")
94
99
  finally:
95
100
  return result
96
101
 
@@ -166,16 +171,20 @@ class ORACLE:
166
171
  dnsName = string_connect["instance"]
167
172
  str_cnn = f"""{database.lower()}{driver}://{user}:{pwd}@{dnsName}"""
168
173
  engine = sqa.create_engine(str_cnn)
169
- result = engine.connect()
170
- self._connection_is_valid = True
171
- self._cnn = result
172
- self.__database_error = f"""{json.dumps(string_connect, indent=4).replace(string_connect["password"], "******")}\nConexao bem sucedida!"""
173
- self._nome_database = gen.nvl(string_connect["database"], "")
174
+ with engine.connect() as connection:
175
+ result = connection.execute(text("Select 1 from dual"))
176
+ #result = engine.connect()
177
+ self._connection_is_valid = True
178
+ self._cnn = result
179
+ self.__database_error = f"""{json.dumps(string_connect, indent=4).replace(string_connect["password"], "******")}\nConexao bem sucedida!"""
180
+ self._nome_database = gen.nvl(string_connect["database"], "")
174
181
  except Exception as error:
175
182
  msg = f"""{json.dumps(string_connect, indent=4).replace(string_connect["password"], "******")}\nFalha ao tentar se conectar com o banco de dados ORACLE (SqlAlchemy)\nException Error: {error} """
176
- result = msg
177
183
  self._connection_is_valid = False
178
184
  self.__database_error = msg
185
+ self._cnn = False
186
+ self._nome_database = gen.nvl(string_connect["database"], "")
187
+ result = self._cnn
179
188
  finally:
180
189
  return result
181
190
  #endregion
@@ -18,6 +18,7 @@ class SQLITE:
18
18
  msg, result = None, True
19
19
  try:
20
20
  __file = os.path.join(conn["host"], conn["instance"])
21
+ __con = ""
21
22
  if os.path.isfile(__file):
22
23
  if "check_same_thread" in kwargs.keys():
23
24
  __check_same_thread = kwargs.get("check_same_thread")
@@ -31,7 +32,7 @@ class SQLITE:
31
32
  engine = sqa.create_engine(f"""sqlite:///{__file}""")
32
33
  __conn = engine.connect()
33
34
  else:
34
- ...
35
+ __conn = ""
35
36
  # driver nativo sqlite
36
37
 
37
38
  self._connection_is_valid = True
@@ -45,6 +46,8 @@ class SQLITE:
45
46
  result = msg
46
47
  self._connection_is_valid = False
47
48
  self.__database_error = msg
49
+ self._nome_database = gen.nvl(conn["database"], "SQLite")
50
+ self.__database_driver = conn["driver_conexao"]
48
51
  finally:
49
52
  return result
50
53
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DE_Lib
3
- Version: 0.0.41
3
+ Version: 0.0.42
4
4
  Summary: Biblioteca de funcionalidades
5
5
  Home-page: https://github.com/DE-DataEng/DE_Lib.git
6
6
  Author: Almir J Gomes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DE_Lib
3
- Version: 0.0.41
3
+ Version: 0.0.42
4
4
  Summary: Biblioteca de funcionalidades
5
5
  Home-page: https://github.com/DE-DataEng/DE_Lib.git
6
6
  Author: Almir J Gomes
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup, find_packages
2
2
  setup(
3
3
  name='DE_Lib',
4
- version='0.0.41',
4
+ version='0.0.42',
5
5
  author='Almir J Gomes',
6
6
  author_email='almir.jg@hotmail.com',
7
7
  packages=find_packages(),
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
File without changes
File without changes
File without changes
File without changes
File without changes