DE-Lib 0.0.36__tar.gz → 0.0.36.2__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.36 → de_lib-0.0.36.2}/DE_LIB.egg-info/PKG-INFO +1 -1
  2. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/OracleDDL.py +32 -8
  3. {de_lib-0.0.36 → de_lib-0.0.36.2}/PKG-INFO +1 -1
  4. {de_lib-0.0.36 → de_lib-0.0.36.2}/setup.py +1 -1
  5. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_LIB.egg-info/SOURCES.txt +0 -0
  6. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_LIB.egg-info/dependency_links.txt +0 -0
  7. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_LIB.egg-info/requires.txt +0 -0
  8. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_LIB.egg-info/top_level.txt +0 -0
  9. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Cloud/__init__.py +0 -0
  10. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/Azure.py +0 -0
  11. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/Cache.py +0 -0
  12. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/Firebird.py +0 -0
  13. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/Informix.py +0 -0
  14. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/Metadata.py +0 -0
  15. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/MsSql.py +0 -0
  16. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/MySql.py +0 -0
  17. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/Oracle.py +0 -0
  18. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/Postgres.py +0 -0
  19. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/RedShift.py +0 -0
  20. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/SQCipher.py +0 -0
  21. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/SQLite.py +0 -0
  22. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/DataBase/__init__.py +0 -0
  23. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/Avro.py +0 -0
  24. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/Csv.py +0 -0
  25. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/JSon.py +0 -0
  26. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/Parquet.py +0 -0
  27. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/Txt.py +0 -0
  28. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/Xlsx.py +0 -0
  29. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/Zip.py +0 -0
  30. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Files/__init__.py +0 -0
  31. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Log/DE_LogEventos.py +0 -0
  32. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Log/Level.py +0 -0
  33. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Log/Log.py +0 -0
  34. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Log/__init__.py +0 -0
  35. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Aes.py +0 -0
  36. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Argon.py +0 -0
  37. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Base64.py +0 -0
  38. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Cipher.py +0 -0
  39. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Fernet.py +0 -0
  40. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Gcm.py +0 -0
  41. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Pbkdf2.py +0 -0
  42. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/Rsa.py +0 -0
  43. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Cipher/__init__.py +0 -0
  44. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Colors.py +0 -0
  45. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/DateUtils.py +0 -0
  46. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Generic.py +0 -0
  47. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/Sql.py +0 -0
  48. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/System.py +0 -0
  49. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/WebHook.py +0 -0
  50. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/Utils/__init__.py +0 -0
  51. {de_lib-0.0.36 → de_lib-0.0.36.2}/DE_Lib/__init__.py +0 -0
  52. {de_lib-0.0.36 → de_lib-0.0.36.2}/LICENCE +0 -0
  53. {de_lib-0.0.36 → de_lib-0.0.36.2}/README.md +0 -0
  54. {de_lib-0.0.36 → de_lib-0.0.36.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DE_Lib
3
- Version: 0.0.36
3
+ Version: 0.0.36.2
4
4
  Summary: Biblioteca de funcionalidades
5
5
  Home-page: https://github.com/DE-DATAx/DAX_DB.git
6
6
  Author: Almir J Gomes
@@ -1,3 +1,5 @@
1
+ from logging import exception
2
+
1
3
  import pandas as pd
2
4
 
3
5
  class OracleDDL:
@@ -27,6 +29,7 @@ class OracleDDL:
27
29
  result = "DATE"
28
30
  else:
29
31
  result = "VARCHAR2(4000)"
32
+ result = "VARCHAR2(4000)"
30
33
  except Exception as error:
31
34
  msg = error
32
35
  result = msg
@@ -48,7 +51,17 @@ class OracleDDL:
48
51
  result = msg
49
52
  finally:
50
53
  return result
51
-
54
+
55
+ def truncate_table(self, table_name):
56
+ msg = result = None, None
57
+ try:
58
+ truncate_table = f"TRUNCATE TABLE {table_name}"
59
+ except Exception as error:
60
+ msg = error
61
+ result = msg
62
+ finally:
63
+ return result
64
+
52
65
  def prepare_data_for_insert(self, df):
53
66
  msg = result = None, None
54
67
  try:
@@ -62,17 +75,20 @@ class OracleDDL:
62
75
  finally:
63
76
  return result
64
77
 
65
- def create_table_and_insert_data(self, df, table_name, conn):
78
+ def create_table_and_insert_data(self, df, table_name, conn, truncate: True):
66
79
  msg = result = None, None
67
80
  try:
68
81
  cur = conn.cursor()
69
82
  try:
70
- cur.execute(f"DROP TABLE {table_name}")
71
- except:
72
- pass # Ignora se a tabela não existir
83
+ if truncate:
84
+ truncate_sql = self.truncate_table(table_name)
85
+ cur.execute(truncate_sql)
86
+ self.Table_was_truncated = truncate
73
87
 
74
- create_sql = self.generate_create_table_sql(table_name, df)
75
- cur.execute(create_sql)
88
+ create_sql = self.generate_create_table_sql(table_name, df)
89
+ cur.execute(create_sql)
90
+ except:
91
+ pass #cur.execute(f"DROP TABLE {table_name}")
76
92
 
77
93
  placeholders = ', '.join([f":{i+1}" for i in range(len(df.columns))])
78
94
  insert_sql = f"INSERT INTO {table_name} VALUES({placeholders})"
@@ -86,4 +102,12 @@ class OracleDDL:
86
102
  msg = error
87
103
  result = msg
88
104
  finally:
89
- return result
105
+ return result
106
+
107
+ @property
108
+ def Table_was_truncated(self):
109
+ return self.__Table_was_truncated
110
+
111
+ @Table_was_truncated.setter
112
+ def Table_was_truncated(self, value):
113
+ self.__Table_was_truncated = value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: DE_Lib
3
- Version: 0.0.36
3
+ Version: 0.0.36.2
4
4
  Summary: Biblioteca de funcionalidades
5
5
  Home-page: https://github.com/DE-DATAx/DAX_DB.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.36',
4
+ version='0.0.36.2',
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