rpa-suite 0.5.1__py3-none-any.whl → 0.6.1__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.
- rpa_suite/clock/exec_while.py +27 -10
- rpa_suite/suite.py +37 -0
- rpa_suite/validate/string_validator.py +10 -9
- {rpa_suite-0.5.1.dist-info → rpa_suite-0.6.1.dist-info}/METADATA +34 -20
- {rpa_suite-0.5.1.dist-info → rpa_suite-0.6.1.dist-info}/RECORD +8 -7
- {rpa_suite-0.5.1.dist-info → rpa_suite-0.6.1.dist-info}/LICENSE +0 -0
- {rpa_suite-0.5.1.dist-info → rpa_suite-0.6.1.dist-info}/WHEEL +0 -0
- {rpa_suite-0.5.1.dist-info → rpa_suite-0.6.1.dist-info}/top_level.txt +0 -0
rpa_suite/clock/exec_while.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
import re
|
1
2
|
from typing import Callable, Any
|
2
|
-
import
|
3
|
-
from rpa_suite.log.printer import
|
3
|
+
from rpa_suite.date.date import get_hms
|
4
|
+
from rpa_suite.log.printer import error_print, success_print
|
4
5
|
|
5
6
|
def exec_wtime(
|
6
7
|
while_time: int,
|
@@ -16,7 +17,7 @@ def exec_wtime(
|
|
16
17
|
----------
|
17
18
|
`while_time: int` - (segundos) representa o tempo que deve persistir a execução da função passada no argumento ``fn_to_exec``
|
18
19
|
|
19
|
-
``fn_to_exec: function`` - (função) a ser chamada durante o temporizador, se houver parametros nessa função podem ser passados como próximos argumentos desta função em ``*args`` e ``**kwargs``
|
20
|
+
``fn_to_exec: function`` - (função) a ser chamada (repetidas vezes) durante o temporizador, se houver parametros nessa função podem ser passados como próximos argumentos desta função em ``*args`` e ``**kwargs``
|
20
21
|
|
21
22
|
Retorno:
|
22
23
|
----------
|
@@ -34,14 +35,30 @@ def exec_wtime(
|
|
34
35
|
result: dict = {
|
35
36
|
'success': bool
|
36
37
|
}
|
38
|
+
run: bool
|
39
|
+
timmer: int
|
40
|
+
|
37
41
|
# Pré Tratamento
|
38
|
-
|
42
|
+
timmer = while_time
|
39
43
|
|
40
44
|
# Processo
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
45
|
+
try:
|
46
|
+
run = True
|
47
|
+
hour, minute, second = get_hms()
|
48
|
+
while run and timmer > 0:
|
49
|
+
fn_to_exec(*args, **kwargs)
|
50
|
+
hour_now, minute_now, second_now = get_hms()
|
51
|
+
if second_now != second:
|
52
|
+
second = second_now
|
53
|
+
timmer =- 1
|
54
|
+
if timmer <= 0:
|
55
|
+
run = False
|
56
|
+
break
|
57
|
+
result['success'] = True
|
58
|
+
success_print(f'Função {fn_to_exec.__name__} foi executada durante: {while_time} seg(s).')
|
59
|
+
|
60
|
+
except Exception as e:
|
61
|
+
result['success'] = False
|
62
|
+
error_print(f'Ocorreu algum erro que impediu a execução da função: {exec_wtime.__name__} corretamente. Erro: {str(e)}')
|
63
|
+
|
47
64
|
return result
|
rpa_suite/suite.py
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
from clock.waiter import wait_for_exec
|
2
|
+
from clock.exec_while import exec_wtime
|
3
|
+
from date.date import get_hms, get_dma
|
4
|
+
from email.sender_smtp import send_email
|
5
|
+
from file.counter import count_files
|
6
|
+
from file.temp_dir import create_temp_dir, delete_temp_dir
|
7
|
+
from log.loggin import logging_decorator
|
8
|
+
from log.printer import alert_print, success_print, error_print, info_print, print_call_fn, print_retur_fn, magenta_print, blue_print
|
9
|
+
from regex.list_from_text import create_list_using_regex
|
10
|
+
from validate.mail_validator import valid_emails
|
11
|
+
from validate.string_validator import search_in
|
12
|
+
|
13
|
+
class Rpa_suite():
|
14
|
+
wait_for_exec = wait_for_exec
|
15
|
+
exec_wtime = exec_wtime
|
16
|
+
get_hms = get_hms
|
17
|
+
get_dma = get_dma
|
18
|
+
send_email = send_email
|
19
|
+
count_files = count_files
|
20
|
+
create_temp_dir = create_temp_dir
|
21
|
+
delete_temp_dir = delete_temp_dir
|
22
|
+
alert_print = alert_print
|
23
|
+
success_print = success_print
|
24
|
+
error_print = error_print
|
25
|
+
info_print = info_print
|
26
|
+
print_call_fn = print_call_fn
|
27
|
+
print_retur_fn = print_retur_fn
|
28
|
+
magenta_print = magenta_print
|
29
|
+
blue_print = blue_print
|
30
|
+
create_list_using_regex = create_list_using_regex
|
31
|
+
valid_emails = valid_emails
|
32
|
+
search_in = search_in
|
33
|
+
|
34
|
+
def invoke_instance_Rpa_suite():
|
35
|
+
rpa_suite_instanced = Rpa_suite()
|
36
|
+
return rpa_suite_instanced
|
37
|
+
|
@@ -56,7 +56,6 @@ def search_in(
|
|
56
56
|
try:
|
57
57
|
if case_sensitivy:
|
58
58
|
result['is_found'] = searched_word in origin_words
|
59
|
-
|
60
59
|
else:
|
61
60
|
words_lowercase = [word.lower() for word in origin_words]
|
62
61
|
searched_word = searched_word.lower()
|
@@ -75,17 +74,19 @@ def search_in(
|
|
75
74
|
except Exception as e:
|
76
75
|
return error_print(f'Não foi possivel concluir a busca de: {searched_word}. Erro: {str(e)}')
|
77
76
|
|
77
|
+
elif search_by == 'regex':
|
78
|
+
pass
|
79
|
+
"""try:
|
80
|
+
if case_sensitivy:
|
81
|
+
print(f'metodo para buscar com sensitivy...')
|
82
|
+
else:
|
83
|
+
print(f'metodo para buscar sem sensitive...')
|
84
|
+
except Exception as e:
|
85
|
+
return print(f'Não foi possivel concluir a busca de: {searched_word}. Erro: {str(e)}')"""
|
86
|
+
|
78
87
|
except Exception as e:
|
79
88
|
return error_print(f'Não foi possivel realizar a busca por: {searched_word}. Erro: {str(e)}')
|
80
89
|
|
81
|
-
"""
|
82
|
-
elif search_by == 'regex':
|
83
|
-
# regex search
|
84
|
-
pass
|
85
|
-
else:
|
86
|
-
error_print(f'por favor digite alguma forma de busca válida para a função, a função aceita: 'string', 'word' e 'regex', como padrões de busca para fazer a pesquisa no texto original.')
|
87
|
-
"""
|
88
|
-
|
89
90
|
# Pós tratamento
|
90
91
|
if result['is_found']:
|
91
92
|
success_print(f'Função: {search_in.__name__} encontrou: {result["number_occurrences"]} ocorrências para "{searched_word}".')
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: rpa-suite
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.1
|
4
4
|
Summary: Conjunto de ferramentas essenciais para RPA com Python, que facilitam o dia a dia de desenvolvimento.
|
5
5
|
Author: Camilo Costa de Carvalho
|
6
6
|
Author-email: camilo.carvalho@triasoftware.com.br
|
@@ -24,7 +24,7 @@ Requires-Dist: email-validator
|
|
24
24
|
</a>
|
25
25
|
</div>
|
26
26
|
<h1 align="center">
|
27
|
-
Suite
|
27
|
+
RPA Suite
|
28
28
|
</h1>
|
29
29
|
|
30
30
|
## Kit de ferramentas para o desenvolvimento do seu bot, automação ou projeto.
|
@@ -37,20 +37,32 @@ Requires-Dist: email-validator
|
|
37
37
|
|
38
38
|
Nosso objetivo é tornar o desenvolvimento de RPAs mais produtivo, oferecendo funções prontas para usos comuns, como:
|
39
39
|
|
40
|
-
-
|
41
|
-
-
|
42
|
-
-
|
43
|
-
-
|
44
|
-
-
|
45
|
-
-
|
40
|
+
- Envio de emails (já configurado e personalizavel)
|
41
|
+
- Validação de emails (limpeza e tratamento)
|
42
|
+
- Busca por palavras, strings ou substrings (patterns) em textos.
|
43
|
+
- Criação e deleção de pasta/arquivo temporário com um comando
|
44
|
+
- Console com mensagens de melhor visualização com cores definidas para alerta, erro, informativo e sucesso.
|
45
|
+
- E muito mais
|
46
46
|
|
47
47
|
### Instalação:
|
48
|
-
Para instalar o projeto, utilize o comando
|
48
|
+
Para **instalar** o projeto, utilize o comando
|
49
49
|
|
50
50
|
>>> python -m pip install rpa-suite
|
51
51
|
|
52
|
+
Para **desinstalar** o projeto, utilize o comando abaixo. **Obs.:** como usamos algumas libs no projeto, lembre-se de desinstar elas caso necessário.
|
53
|
+
|
54
|
+
>>> python -m pip uninstall rpa-suite loguru email-validator colorama
|
55
|
+
|
56
|
+
### Exemplo de uso:
|
57
|
+
Como nosso projeto é dividido em submodulos, é necessario usar from rpa_suite e navegar até o módulo/submódulo desejado para fazer o import. No exemplo abaixo estamos acessando o modulo **clock** que possui submódulos dedicados a funções relacionadas a tempo:
|
58
|
+
|
59
|
+
from rpa_suite.clock.waiter import wait_for_exec
|
60
|
+
|
61
|
+
# esperar x segundos, executa a função y, usando os paramentros z, w
|
62
|
+
wait_for_exec(x, y, z, w)
|
63
|
+
|
52
64
|
### Dependencias:
|
53
|
-
No setup do nosso projeto já estão inclusas as
|
65
|
+
No setup do nosso projeto já estão inclusas as dependências, só será necessário instalar nossa **Lib**, mas segue a lista das libs usadas:
|
54
66
|
- colorama
|
55
67
|
- loguru
|
56
68
|
- email-validator
|
@@ -59,23 +71,25 @@ No setup do nosso projeto já estão inclusas as dependencias, só será necessa
|
|
59
71
|
O módulo principal do rpa-suite é dividido em categorias. Cada categoria contém módulos com funções destinadas a cada tipo de tarefa
|
60
72
|
- **rpa_suite**
|
61
73
|
- **clock**
|
62
|
-
- **waiter** -
|
74
|
+
- **waiter** - Funções para aguardar execução
|
63
75
|
- **date**
|
64
|
-
- **date** -
|
76
|
+
- **date** - Funções para capturar data, mes, ano, hora, minutos de forma individual em apenas uma linha
|
65
77
|
- **email**
|
66
|
-
- **sender_smtp** -
|
78
|
+
- **sender_smtp** - Funções para envio de email SMPT
|
67
79
|
- **file**
|
68
|
-
- **counter** -
|
69
|
-
- **temp_dir** -
|
80
|
+
- **counter** - Funções para contagens
|
81
|
+
- **temp_dir** - Funções para diretórios temporários
|
70
82
|
- **log**
|
71
|
-
- **loggin** -
|
72
|
-
- **printer** -
|
83
|
+
- **loggin** - Funções decoradoras com log de execução das funções
|
84
|
+
- **printer** - Funções print personalizados (alerta, erro, sucesso, informativo)
|
85
|
+
- **regex**
|
86
|
+
- **list_from_text** - Funções para gerar listas, dividindo texto usando padrão regex
|
73
87
|
- **validate**
|
74
|
-
- **mail_validator** -
|
75
|
-
- **string_validator** -
|
88
|
+
- **mail_validator** - Funções para validação de emails
|
89
|
+
- **string_validator** - Funções para validação/varredura (strings, substrings, palavras)
|
76
90
|
|
77
91
|
### Versão do projeto:
|
78
|
-
A versão mais recente é a **Alpha 0.
|
92
|
+
A versão mais recente é a **Alpha 0.6.1**, lançada em *02/12/2023*. O projeto está atualmente em desenvolvimento.
|
79
93
|
|
80
94
|
### Mais Sobre:
|
81
95
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
rpa_suite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
rpa_suite/suite.py,sha256=v11EVpvX6W9d9qzeegyzfjnJOkqo_oPV-RI49M6s7VY,1355
|
2
3
|
rpa_suite/clock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
rpa_suite/clock/exec_while.py,sha256=
|
4
|
+
rpa_suite/clock/exec_while.py,sha256=3lHxKBmacT5lFtcZzDZGoWqr4S2gggY69VfXB96NGmw,2485
|
4
5
|
rpa_suite/clock/waiter.py,sha256=WFPPBuDflgJrMtBKcRihJJUVECVLuPZepAy9aGm_UW4,1981
|
5
6
|
rpa_suite/date/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
7
|
rpa_suite/date/date.py,sha256=5VXiQehSsd-0RmGnZ_amdGfxyBu3a7A-Go-KUt34tIw,2826
|
@@ -14,9 +15,9 @@ rpa_suite/log/loggin.py,sha256=3f7JdA2zp6mTperx406zbud8v0miwhHLTkT2sxMy63M,872
|
|
14
15
|
rpa_suite/log/printer.py,sha256=yzFO6MBgbsbaFzEnq9l0PcUTgb9fjQiPMAYDV20lhEA,2805
|
15
16
|
rpa_suite/validate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
17
|
rpa_suite/validate/mail_validator.py,sha256=kGifg4ydz8Oh50Hr37t0Py82u4vUap7yzABGQOKE1lQ,2165
|
17
|
-
rpa_suite/validate/string_validator.py,sha256=
|
18
|
-
rpa_suite-0.
|
19
|
-
rpa_suite-0.
|
20
|
-
rpa_suite-0.
|
21
|
-
rpa_suite-0.
|
22
|
-
rpa_suite-0.
|
18
|
+
rpa_suite/validate/string_validator.py,sha256=wvgh9ZRl6P62W-kNII3heKXhbYaZUoIOOnWkOFO1PH0,4052
|
19
|
+
rpa_suite-0.6.1.dist-info/LICENSE,sha256=5D8PIbs31iGd9i1_MDNg4SzaQnp9sEIULALh2y3WyMI,1102
|
20
|
+
rpa_suite-0.6.1.dist-info/METADATA,sha256=T5wDTfPwLVYG_Wkr8CL2SSsoNLKnRwpdEGXP1IesbEo,4588
|
21
|
+
rpa_suite-0.6.1.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
22
|
+
rpa_suite-0.6.1.dist-info/top_level.txt,sha256=HYkDtg-kJNAr3F2XAIPyJ-QBbNhk7q6jrqsFt10lz4Y,10
|
23
|
+
rpa_suite-0.6.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|