DE-Lib 0.0.20__py3-none-any.whl
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.
- DE_Lib/Cloud/__init__.py +0 -0
- DE_Lib/DataBase/Azure.py +44 -0
- DE_Lib/DataBase/Cache.py +74 -0
- DE_Lib/DataBase/Firebird.py +45 -0
- DE_Lib/DataBase/Informix.py +37 -0
- DE_Lib/DataBase/Metadata.py +62 -0
- DE_Lib/DataBase/MsSql.py +39 -0
- DE_Lib/DataBase/MySql.py +42 -0
- DE_Lib/DataBase/Oracle.py +111 -0
- DE_Lib/DataBase/Postgres.py +39 -0
- DE_Lib/DataBase/RedShift.py +42 -0
- DE_Lib/DataBase/SQCipher.py +42 -0
- DE_Lib/DataBase/SQLite.py +48 -0
- DE_Lib/DataBase/__init__.py +0 -0
- DE_Lib/Files/Avro.py +23 -0
- DE_Lib/Files/Csv.py +64 -0
- DE_Lib/Files/JSon.py +64 -0
- DE_Lib/Files/Parquet.py +31 -0
- DE_Lib/Files/Txt.py +64 -0
- DE_Lib/Files/Xlsx.py +55 -0
- DE_Lib/Files/__init__.py +0 -0
- DE_Lib/Log/DE_LogEventos.py +533 -0
- DE_Lib/Log/Level.py +77 -0
- DE_Lib/Log/Log.py +470 -0
- DE_Lib/Log/__init__.py +0 -0
- DE_Lib/Utils/Cipher/Aes.py +65 -0
- DE_Lib/Utils/Cipher/Argon.py +37 -0
- DE_Lib/Utils/Cipher/Base64.py +48 -0
- DE_Lib/Utils/Cipher/Cipher.py +300 -0
- DE_Lib/Utils/Cipher/Fernet.py +81 -0
- DE_Lib/Utils/Cipher/Gcm.py +78 -0
- DE_Lib/Utils/Cipher/Pbkdf2.py +43 -0
- DE_Lib/Utils/Cipher/Rsa.py +140 -0
- DE_Lib/Utils/Cipher/__init__.py +0 -0
- DE_Lib/Utils/Colors.py +203 -0
- DE_Lib/Utils/DateUtils.py +215 -0
- DE_Lib/Utils/Generic.py +249 -0
- DE_Lib/Utils/SQL.py +34 -0
- DE_Lib/Utils/System.py +50 -0
- DE_Lib/Utils/WebHook.py +18 -0
- DE_Lib/Utils/__init__.py +0 -0
- DE_Lib/__init__.py +0 -0
- de_lib-0.0.20.dist-info/LICENCE +21 -0
- de_lib-0.0.20.dist-info/METADATA +68 -0
- de_lib-0.0.20.dist-info/RECORD +47 -0
- de_lib-0.0.20.dist-info/WHEEL +5 -0
- de_lib-0.0.20.dist-info/top_level.txt +1 -0
DE_Lib/Utils/System.py
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
import os
|
2
|
+
import signal
|
3
|
+
import socket as skt
|
4
|
+
import platform as so
|
5
|
+
|
6
|
+
class SO:
|
7
|
+
def __init__(self):
|
8
|
+
self.__msg = {} # mensagems para funcionalidades
|
9
|
+
|
10
|
+
|
11
|
+
def ping(self, hostname) -> bool:
|
12
|
+
msg, result = None, False
|
13
|
+
# hostname = "google.com" # example
|
14
|
+
response = os.system("ping -n 1 " + hostname + " >> trash_ping.log")
|
15
|
+
# and then check the response...
|
16
|
+
if response == 0:
|
17
|
+
self.__msg["ping"] = f"""{hostname} Sucesso!"""
|
18
|
+
result = True
|
19
|
+
else:
|
20
|
+
self.__msg["ping"] = f"""{hostname} Não encontrado!"""
|
21
|
+
return result
|
22
|
+
|
23
|
+
def killPID(self, pid):
|
24
|
+
msg, result = None, True
|
25
|
+
try:
|
26
|
+
os.kill(pid, signal.SIGKILL)
|
27
|
+
self.__msg["pid"] = "PID eliminado!"
|
28
|
+
except Exception as error:
|
29
|
+
self.__msg["pid"] = f"""Erro ao tentar eliminar o PID!\n{error}"""
|
30
|
+
result = False
|
31
|
+
finally:
|
32
|
+
return result
|
33
|
+
|
34
|
+
@property
|
35
|
+
def PID(self):
|
36
|
+
return os.getpid()
|
37
|
+
|
38
|
+
@property
|
39
|
+
def OSINFO(self):
|
40
|
+
result = {"user_db": None,
|
41
|
+
"local_ip": skt.gethostbyname(skt.gethostname()),
|
42
|
+
"local_name": skt.gethostname(),
|
43
|
+
"processor": so.machine(),
|
44
|
+
"os_user": os.getlogin(),
|
45
|
+
"so_platform": so.platform(),
|
46
|
+
"so_system": so.system(),
|
47
|
+
"so_version": so.version()
|
48
|
+
}
|
49
|
+
return result
|
50
|
+
|
DE_Lib/Utils/WebHook.py
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
class WebHook:
|
4
|
+
def __init__(self):
|
5
|
+
...
|
6
|
+
|
7
|
+
@staticmethod
|
8
|
+
def post_message_to_slack(token, channel, text, icon_emoji, username, blocks=None,
|
9
|
+
url="https://slack.com/api/chat.postMessage"):
|
10
|
+
return requests.post(url,
|
11
|
+
{'token': token,
|
12
|
+
'channel': channel,
|
13
|
+
'text': text,
|
14
|
+
'icon_emoji': icon_emoji,
|
15
|
+
'username': username,
|
16
|
+
'blocks': json.dumps(blocks) if blocks else None
|
17
|
+
}
|
18
|
+
).json()
|
DE_Lib/Utils/__init__.py
ADDED
File without changes
|
DE_Lib/__init__.py
ADDED
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) [year] [fullname]
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,68 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: DE_Lib
|
3
|
+
Version: 0.0.20
|
4
|
+
Summary: Biblioteca de funcionalidades
|
5
|
+
Home-page: https://github.com/DE-DATAx/DAX_DB.git
|
6
|
+
Author: Almir J Gomes
|
7
|
+
Author-email: almir.jg@hotmail.com
|
8
|
+
Description-Content-Type: text/markdown
|
9
|
+
License-File: LICENCE
|
10
|
+
Requires-Dist: fbd
|
11
|
+
Requires-Dist: cx_Oracle
|
12
|
+
Requires-Dist: JayDeBeApi
|
13
|
+
Requires-Dist: mysql.connector
|
14
|
+
Requires-Dist: psycopg2
|
15
|
+
Requires-Dist: pymssql
|
16
|
+
Requires-Dist: redshift-connector
|
17
|
+
Requires-Dist: SQLAlchemy==2.0.38
|
18
|
+
Requires-Dist: bcrypt==4.3.0
|
19
|
+
Requires-Dist: argon2-cffi==23.1.0
|
20
|
+
Dynamic: author
|
21
|
+
Dynamic: author-email
|
22
|
+
Dynamic: description
|
23
|
+
Dynamic: description-content-type
|
24
|
+
Dynamic: home-page
|
25
|
+
Dynamic: requires-dist
|
26
|
+
Dynamic: summary
|
27
|
+
|
28
|
+
<h1>DAX_UTIL</h1>
|
29
|
+
|
30
|
+
## **Biblioteca de funcionalidades**
|
31
|
+
|
32
|
+
## Conteudo
|
33
|
+
|
34
|
+
Os pacotes que compoem esta biblioteca sao:<br>
|
35
|
+
- Cipher<br>
|
36
|
+
- DateUtils<br>
|
37
|
+
- Generic<br>
|
38
|
+
- SQL<br>
|
39
|
+
- System<br>
|
40
|
+
- WebHook<br>
|
41
|
+
|
42
|
+
<h3>Descricao dos pacotes...</h3>
|
43
|
+
<h2>Cipher:</h2>
|
44
|
+
|
45
|
+
Pacote responsavel por criptografar e descriptografar conteudos, composta
|
46
|
+
por tres classes: RSA, AES e B64.
|
47
|
+
Peculiaridades de cada uma destas classes:<br>
|
48
|
+
- <b>RSA</b>: Criptografa textos curtos
|
49
|
+
- <b>AES</b>: Criptografa textos longos (faz uso tambem da RSA)
|
50
|
+
- <b>B64</b>: Criptografia mais vulneravel
|
51
|
+
|
52
|
+
<b><u>from Utils.Cipher import RSA, AES, B64</b></u>
|
53
|
+
|
54
|
+
Apesar de criptografar qualquer tipo de valor, nao e recomendada utilizar
|
55
|
+
para senhas ou informacoes sensiveis pois sua vulnerabilidade e grande.<br>
|
56
|
+
***Em breve sera disponibilizadas funcionalidades para este fim neste pacote
|
57
|
+
|
58
|
+
<h2>DateUtils</h2> Pacote responsavel por manipulacao de datas e horas
|
59
|
+
<h2>Generic</h2>Funcionalidades de utilizacao generica. Principal foco e facilitar e
|
60
|
+
diminuir aqueles codigos que ocupam varias linhas suprimindo-os em apenas uma linha,
|
61
|
+
quando possivel. Ex.:<br>
|
62
|
+
- NVL() --> Equivalente ao NVL do ORACLE. nvl(None, "a")<br>
|
63
|
+
- IIF() --> If de uma linha so IF(value_boolean, value_True, value_False)<br>
|
64
|
+
- entre outras funconalidades<br>
|
65
|
+
|
66
|
+
<h2>SQL</h2>Ainda em desenvolvimento. Com objetivo de facilitar obtencao de valores de cursores, etc.
|
67
|
+
<h2>System</h2>Obtem informacoes do sistema operacional
|
68
|
+
<h2>WebHook</h2>Funcionalidades para conversar com TEAMS e SLACK
|
@@ -0,0 +1,47 @@
|
|
1
|
+
DE_Lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
DE_Lib/Cloud/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
+
DE_Lib/DataBase/Azure.py,sha256=HitwT0zPyrKmYNziLRJq5NPPyRs10iTnzaxYQiKL9-E,1326
|
4
|
+
DE_Lib/DataBase/Cache.py,sha256=2QBnd_Sp823HhKfkg12ouGxTZ3K28wik9Sjl8ZdxJ2c,3091
|
5
|
+
DE_Lib/DataBase/Firebird.py,sha256=Zg1V2LWckqKSq_qkJIxV8DA6fdwvrjSY4FxhKKPZq7I,1422
|
6
|
+
DE_Lib/DataBase/Informix.py,sha256=8ZYuwrG4zlyUsbxJKgY9GNYSboVRN9e5VqGHwkC72aM,981
|
7
|
+
DE_Lib/DataBase/Metadata.py,sha256=i_39_0FGRfGAQZmKqi40pB59n8aDaDrCIP1NtpDfVCU,3274
|
8
|
+
DE_Lib/DataBase/MsSql.py,sha256=FOI6H3QmXCbalu-58auHvU_eDrJsbqkwUu5fyPHda6g,1215
|
9
|
+
DE_Lib/DataBase/MySql.py,sha256=0BmcV5te3RAR6tAGv_ozVTdb11xghzSaQo6VJWrlt8Q,1570
|
10
|
+
DE_Lib/DataBase/Oracle.py,sha256=NW86ij4upZ93tVrhFmA3Bs1DWqi7mQWampysGnOrAKs,4914
|
11
|
+
DE_Lib/DataBase/Postgres.py,sha256=s3et88gq6aUXK9_HU773GuI9UE7mwJwovbmBjFIW_9Y,1277
|
12
|
+
DE_Lib/DataBase/RedShift.py,sha256=XcuoGixSwaOvgABreDzic_snX_7C8To-2omRk8kJxiI,1250
|
13
|
+
DE_Lib/DataBase/SQCipher.py,sha256=pWtasnkEg0l7GN_GyOb3vvzeGp3G-1M7fqAPSJTNUJk,1230
|
14
|
+
DE_Lib/DataBase/SQLite.py,sha256=WR7X-BZesp-7ka4weATqbjjVty9l1GqjzqyRfOw3KsM,1643
|
15
|
+
DE_Lib/DataBase/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
+
DE_Lib/Files/Avro.py,sha256=hVXwoOSESHzWROBNYSDOu4myIrcRqSiPqGLRA40vJAk,527
|
17
|
+
DE_Lib/Files/Csv.py,sha256=8mpD2g4Ej2RHQvxMODEpBDbxMV5pWJ8dJHyO8YZchuk,2430
|
18
|
+
DE_Lib/Files/JSon.py,sha256=tRdUou9YXH4TLGzJrQb2yCT2vVhudSydCkD8s2lV1I4,2460
|
19
|
+
DE_Lib/Files/Parquet.py,sha256=SP7JHOznW_x3DHIknYQk9qEIRMaknFlGH9cvVQ3Siu0,882
|
20
|
+
DE_Lib/Files/Txt.py,sha256=9FdjrBtGJY6j6tTIbNZ1tMKIxdOKKAVjd5hDAWxzw5w,2430
|
21
|
+
DE_Lib/Files/Xlsx.py,sha256=V1Ll_2i7nzGBwyGrXMHDX79j5RH50XY8sz06N4hLvOw,2018
|
22
|
+
DE_Lib/Files/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
|
+
DE_Lib/Log/DE_LogEventos.py,sha256=_L3ChUr9MLxLO0cjTuzmvs50Cmhvmxj7NnAxYBq_wH8,19409
|
24
|
+
DE_Lib/Log/Level.py,sha256=2CN44MncIBGVTW5jdYpMPxzrW6sjoEBU1TsSSv4CGhs,2435
|
25
|
+
DE_Lib/Log/Log.py,sha256=RxHoJJH0Ej8iPXIPcDTYLs3schZV0kSozlzTSJzAOP8,18105
|
26
|
+
DE_Lib/Log/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
+
DE_Lib/Utils/Colors.py,sha256=-HX3Mx9hQhVN3mbmp3AGv_RhZ1i_-yg2YWYYL82ewvg,5984
|
28
|
+
DE_Lib/Utils/DateUtils.py,sha256=-xGQe4IIOUiJxeXLuq2uAlLqsxoCWPIhUMj3Heym2OU,7818
|
29
|
+
DE_Lib/Utils/Generic.py,sha256=jQOAGhZoXjP15m6LoCABGmOuoFrgFJUH2JVoRHmN3BA,7996
|
30
|
+
DE_Lib/Utils/SQL.py,sha256=fJytwrr1mSPttqXL4ekjKNV2r0cXzMABOKhMlJ-y5Ns,1298
|
31
|
+
DE_Lib/Utils/System.py,sha256=kp0hBml9Z95PNAEun5CPCpYnVM7K6XnJjLNQO0CG3Po,1532
|
32
|
+
DE_Lib/Utils/WebHook.py,sha256=HepooqhH7nPEdhuhYvhvl_H4vywOm9EszXrbVfFc55o,685
|
33
|
+
DE_Lib/Utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
34
|
+
DE_Lib/Utils/Cipher/Aes.py,sha256=Ufcc_dl2WY1p-YeFBH97ble4DSA8G9kRbsscKyAyMz4,2287
|
35
|
+
DE_Lib/Utils/Cipher/Argon.py,sha256=rwQnbUCP9ZZDKTRaTStymsPguR6tT1b52q5inPwsqCc,967
|
36
|
+
DE_Lib/Utils/Cipher/Base64.py,sha256=DujKjwjs0fKOBdM5jvCh4Ntv2wsdmXOKAzBhxbwijLM,1527
|
37
|
+
DE_Lib/Utils/Cipher/Cipher.py,sha256=tBh9kD3KIkkvNrFztidt09spV52-pUFa9iHy18m_Q40,9087
|
38
|
+
DE_Lib/Utils/Cipher/Fernet.py,sha256=jQMvGJ6UbDkJE7Jbt7FwWmrJkH-aBG_kRKqyHpn8S5g,2115
|
39
|
+
DE_Lib/Utils/Cipher/Gcm.py,sha256=fOuCVOyd4sGv389E91yqomujKTtFZu6CyhySrmQKVfY,2383
|
40
|
+
DE_Lib/Utils/Cipher/Pbkdf2.py,sha256=hRkgf0Fo5hV1gLbWlFGFzhYYUjPEqgpB2R-pPw7N2F8,1210
|
41
|
+
DE_Lib/Utils/Cipher/Rsa.py,sha256=MYG1YsGuq-Q-MoF6pmeMD0TyxMTwt6tuUaLvXcmzQ2k,4126
|
42
|
+
DE_Lib/Utils/Cipher/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
43
|
+
de_lib-0.0.20.dist-info/LICENCE,sha256=Qv2ilebwoUtMJnRsZwRy729xS5JZQzLauJ0tQzkAkTA,1088
|
44
|
+
de_lib-0.0.20.dist-info/METADATA,sha256=Xuyi_FHDh11xj2lbW2TD80FVG5SulB7r-WSq5iWdwqo,2264
|
45
|
+
de_lib-0.0.20.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
46
|
+
de_lib-0.0.20.dist-info/top_level.txt,sha256=yI9fdM_jkhCz_sykPZQbfeUbQ1FRMt-xjv9fJ6YZVLE,7
|
47
|
+
de_lib-0.0.20.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
DE_Lib
|