rpa-suite 1.1.4__tar.gz → 1.1.6__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.
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/PKG-INFO +3 -2
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/README.md +2 -1
- rpa_suite-1.1.6/rpa_suite/file/__create_ss_dir.py +83 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/file/screen_shot.py +27 -21
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/printer.py +8 -8
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite.egg-info/PKG-INFO +3 -2
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite.egg-info/SOURCES.txt +1 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/setup.py +1 -1
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/LICENSE +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/clock/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/clock/exec_at.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/clock/scheduler.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/clock/waiter.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/date/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/date/date.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/email/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/email/sender_smtp.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/file/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/file/counter.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/file/temp_dir.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/__create_log_dir.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/_functions_logger.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/_logger.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/_variables.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/_variables_uru.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/functions_logger_uru.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/log_decorator.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/log/logger_uru.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/regex/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/regex/list_from_text.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/suite.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/validate/__init__.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/validate/mail_validator.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite/validate/string_validator.py +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite.egg-info/dependency_links.txt +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite.egg-info/requires.txt +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/rpa_suite.egg-info/top_level.txt +0 -0
- {rpa_suite-1.1.4 → rpa_suite-1.1.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: rpa_suite
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.6
|
4
4
|
Summary: Conjunto de ferramentas essenciais para Automação 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
|
@@ -156,9 +156,10 @@ O módulo principal do rpa-suite é dividido em categorias. Cada categoria cont
|
|
156
156
|
- **string_validator** - Função que valida presença de letras, palavras, e texto em strings
|
157
157
|
|
158
158
|
## Release
|
159
|
-
Versão: **Beta 1.1.
|
159
|
+
Versão: **Beta 1.1.6**
|
160
160
|
|
161
161
|
Lançamento: *20/02/2024*
|
162
|
+
Última atualização: *09/09/2024*
|
162
163
|
|
163
164
|
Status: Em desenvolvimento.
|
164
165
|
|
@@ -131,9 +131,10 @@ O módulo principal do rpa-suite é dividido em categorias. Cada categoria cont
|
|
131
131
|
- **string_validator** - Função que valida presença de letras, palavras, e texto em strings
|
132
132
|
|
133
133
|
## Release
|
134
|
-
Versão: **Beta 1.1.
|
134
|
+
Versão: **Beta 1.1.6**
|
135
135
|
|
136
136
|
Lançamento: *20/02/2024*
|
137
|
+
Última atualização: *09/09/2024*
|
137
138
|
|
138
139
|
Status: Em desenvolvimento.
|
139
140
|
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# /_create_ss_dir.py
|
2
|
+
|
3
|
+
import os
|
4
|
+
from typing import Union
|
5
|
+
from rpa_suite.log.printer import error_print, alert_print, success_print
|
6
|
+
|
7
|
+
|
8
|
+
def __create_ss_dir(path_to_create: str = 'default', name_ss_dir: str='screenshots') -> dict[str, Union[bool, str, None]]:
|
9
|
+
|
10
|
+
"""
|
11
|
+
Function responsible for creating a screenshots directory to work with your screenshot files. \n
|
12
|
+
|
13
|
+
Parameters:
|
14
|
+
----------
|
15
|
+
``path_to_create: str`` - should be a string with the full path pointing to the folder where the screenshots folder should be created, if it is empty the ``default`` value will be used which will create a folder in the current directory where the file containing this function was called.
|
16
|
+
|
17
|
+
``name_ss_dir: str`` - should be a string representing the name of the logger directory to be created. If it is empty, the ``temp`` value will be used as the default directory name.
|
18
|
+
|
19
|
+
Return:
|
20
|
+
----------
|
21
|
+
>>> type:dict
|
22
|
+
* 'success': bool - represents case the action was performed successfully
|
23
|
+
* 'path_created': str - path of the directory that was created on the process
|
24
|
+
|
25
|
+
Description: pt-br
|
26
|
+
----------
|
27
|
+
Função responsavel por criar diretório de screenshots para trabalhar com seus arquivos de sreenshot. \n
|
28
|
+
|
29
|
+
Parametros:
|
30
|
+
----------
|
31
|
+
``path_to_create: str`` - deve ser uma string com o path completo apontando para a pasta onde deve ser criada a pasta temporaria, se estiver vazio sera usado valor ``default`` que criará pasta no diretório atual onde o arquivo contendo esta função foi chamada.
|
32
|
+
|
33
|
+
``name_ss_dir: str`` - deve ser uma string representando o nome do diretório de screenshots a ser criado. Se estiver vazio, o valor ``screenshots`` será usado como o nome padrão do diretório.
|
34
|
+
|
35
|
+
Retorno:
|
36
|
+
----------
|
37
|
+
>>> type:dict
|
38
|
+
* 'success': bool - representa se ação foi realizada com sucesso
|
39
|
+
* 'path_created': str - path do diretório que foi criado no processo
|
40
|
+
"""
|
41
|
+
|
42
|
+
# Local Variables
|
43
|
+
result: dict = {
|
44
|
+
'success': bool,
|
45
|
+
'path_created': str,
|
46
|
+
}
|
47
|
+
|
48
|
+
try:
|
49
|
+
# by 'default', defines path to local script execution path
|
50
|
+
if path_to_create == 'default':
|
51
|
+
path_to_create: str = os.getcwd()
|
52
|
+
|
53
|
+
# Build path to new dir
|
54
|
+
full_path: str = os.path.join(path_to_create, name_ss_dir)
|
55
|
+
|
56
|
+
# Create dir in this block
|
57
|
+
try:
|
58
|
+
|
59
|
+
# Successefully created
|
60
|
+
os.makedirs(full_path, exist_ok=False)
|
61
|
+
|
62
|
+
result['success'] = True
|
63
|
+
result['path_created'] = fr'{full_path}'
|
64
|
+
|
65
|
+
success_print(f"Diretório:'{full_path}' foi criado com sucesso.")
|
66
|
+
|
67
|
+
except FileExistsError:
|
68
|
+
result['success'] = False
|
69
|
+
result['path_created'] = full_path
|
70
|
+
# alert_print(f"Diretório:'{full_path}' já existe.")
|
71
|
+
|
72
|
+
except PermissionError:
|
73
|
+
result['success'] = False
|
74
|
+
result['path_created'] = None
|
75
|
+
alert_print(f"Permissão negada: não é possível criar o diretório '{full_path}'.")
|
76
|
+
|
77
|
+
except Exception as e:
|
78
|
+
result['success'] = False
|
79
|
+
result['path_created'] = None
|
80
|
+
error_print(f'Error capturing current path to create screenshots directory! Error: {str(e)}')
|
81
|
+
|
82
|
+
finally:
|
83
|
+
return result
|
@@ -2,18 +2,13 @@
|
|
2
2
|
|
3
3
|
import os, time
|
4
4
|
from datetime import datetime
|
5
|
-
from rpa_suite.log.printer import error_print
|
5
|
+
from rpa_suite.log.printer import error_print, success_print
|
6
|
+
from .__create_ss_dir import __create_ss_dir
|
6
7
|
|
7
8
|
|
8
|
-
try:
|
9
|
-
import pyautogui
|
10
|
-
import pyscreeze
|
11
|
-
|
12
|
-
except ImportError:
|
13
|
-
raise ImportError(" The ‘pyautogui’, ‘Pillow’, and ‘PyScreeze’ libraries are necessary to use this module. Please install them with ‘pip install pyautogui pillow pyscreeze’.")
|
14
9
|
|
15
10
|
|
16
|
-
def screen_shot(
|
11
|
+
def screen_shot(path_dir:str = None, file_name: str = 'screenshot', save_with_date: bool = True, delay: int = 1, use_default_path_and_name: bool = True, name_ss_dir:str = None) -> str | None:
|
17
12
|
|
18
13
|
"""
|
19
14
|
Function responsible for create a dir for screenshot, and file screenshot and save this in dir to create, if dir exists save it on original dir. By default uses date on file name. \n
|
@@ -50,30 +45,41 @@ def screen_shot(file_path: str, file_name: str = 'screenshot', save_with_date: b
|
|
50
45
|
# proccess
|
51
46
|
try:
|
52
47
|
|
48
|
+
try:
|
49
|
+
import pyautogui
|
50
|
+
import pyscreeze
|
51
|
+
|
52
|
+
except ImportError:
|
53
|
+
raise ImportError(" The ‘pyautogui’ e ‘Pillow’ libraries are necessary to use this module. Please install them with ‘pip install pyautogui pillow.")
|
54
|
+
|
53
55
|
time.sleep(delay)
|
54
|
-
if not os.path.exists(file_path):
|
55
|
-
|
56
|
-
# if dir not exists create it
|
57
|
-
try:
|
58
|
-
os.makedirs(file_path)
|
59
56
|
|
60
|
-
|
61
|
-
|
57
|
+
if not use_default_path_and_name:
|
58
|
+
result_tryed: dict = __create_ss_dir(path_dir, name_ss_dir)
|
59
|
+
path_dir = result_tryed['path_created']
|
60
|
+
else:
|
61
|
+
if path_dir == None and name_ss_dir == None:
|
62
|
+
result_tryed: dict = __create_ss_dir()
|
63
|
+
path_dir = result_tryed['path_created']
|
62
64
|
|
63
65
|
|
64
66
|
if save_with_date: # use date on file name
|
65
67
|
image = pyautogui.screenshot()
|
66
|
-
|
67
|
-
|
68
|
+
file_name = f'{file_name}_{datetime.today().strftime("%d_%m_%Y-%H_%M_%S")}.png'
|
69
|
+
path_file_screenshoted = os.path.join(path_dir, file_name)
|
70
|
+
|
71
|
+
success_print(path_file_screenshoted)
|
72
|
+
|
68
73
|
image.save(path_file_screenshoted)
|
69
|
-
return
|
74
|
+
return path_file_screenshoted
|
70
75
|
|
71
76
|
else: # not use date on file name
|
72
77
|
image = pyautogui.screenshot()
|
73
|
-
|
74
|
-
|
78
|
+
file_name = f'{file_name}.png'
|
79
|
+
path_file_screenshoted = os.path.join(path_dir, file_name)
|
80
|
+
|
75
81
|
image.save(path_file_screenshoted)
|
76
|
-
return
|
82
|
+
return path_file_screenshoted
|
77
83
|
|
78
84
|
except Exception as e:
|
79
85
|
|
@@ -33,7 +33,7 @@ def success_print(string_text: str, color=Colors.green, ending="\n") -> None:
|
|
33
33
|
----------
|
34
34
|
>>> type:None
|
35
35
|
"""
|
36
|
-
print(f'{color}
|
36
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
37
37
|
|
38
38
|
|
39
39
|
def alert_print(string_text: str, color=Colors.yellow, ending="\n") -> None:
|
@@ -51,7 +51,7 @@ def alert_print(string_text: str, color=Colors.yellow, ending="\n") -> None:
|
|
51
51
|
----------
|
52
52
|
>>> type:None
|
53
53
|
"""
|
54
|
-
print(f'{color}
|
54
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
55
55
|
|
56
56
|
|
57
57
|
def info_print(string_text: str, color=Colors.cyan, ending="\n") -> None:
|
@@ -69,7 +69,7 @@ def info_print(string_text: str, color=Colors.cyan, ending="\n") -> None:
|
|
69
69
|
----------
|
70
70
|
>>> type:None
|
71
71
|
"""
|
72
|
-
print(f'{color}
|
72
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
73
73
|
|
74
74
|
|
75
75
|
def error_print(string_text: str, color=Colors.red, ending="\n") -> None:
|
@@ -87,7 +87,7 @@ def error_print(string_text: str, color=Colors.red, ending="\n") -> None:
|
|
87
87
|
----------
|
88
88
|
>>> type:None
|
89
89
|
"""
|
90
|
-
print(f'{color}
|
90
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
91
91
|
|
92
92
|
|
93
93
|
def magenta_print(string_text: str, color=Colors.magenta, ending="\n") -> None:
|
@@ -105,7 +105,7 @@ def magenta_print(string_text: str, color=Colors.magenta, ending="\n") -> None:
|
|
105
105
|
----------
|
106
106
|
>>> type:None
|
107
107
|
"""
|
108
|
-
print(f'{color}
|
108
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
109
109
|
|
110
110
|
|
111
111
|
def blue_print(string_text: str, color=Colors.blue, ending="\n") -> None:
|
@@ -123,7 +123,7 @@ def blue_print(string_text: str, color=Colors.blue, ending="\n") -> None:
|
|
123
123
|
----------
|
124
124
|
>>> type:None
|
125
125
|
"""
|
126
|
-
print(f'{color}
|
126
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
127
127
|
|
128
128
|
|
129
129
|
def print_call_fn(string_text: str, color=Colors.call_fn, ending="\n") -> None:
|
@@ -142,7 +142,7 @@ def print_call_fn(string_text: str, color=Colors.call_fn, ending="\n") -> None:
|
|
142
142
|
----------
|
143
143
|
>>> type:None
|
144
144
|
"""
|
145
|
-
print(f'{color}
|
145
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
146
146
|
|
147
147
|
|
148
148
|
def print_retur_fn(string_text: str, color=Colors.retur_fn, ending="\n") -> None:
|
@@ -161,4 +161,4 @@ def print_retur_fn(string_text: str, color=Colors.retur_fn, ending="\n") -> None
|
|
161
161
|
----------
|
162
162
|
>>> type:None
|
163
163
|
"""
|
164
|
-
print(f'{color}
|
164
|
+
print(f'{color}{string_text}{Colors.default}', end=ending)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: rpa-suite
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.6
|
4
4
|
Summary: Conjunto de ferramentas essenciais para Automação 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
|
@@ -156,9 +156,10 @@ O módulo principal do rpa-suite é dividido em categorias. Cada categoria cont
|
|
156
156
|
- **string_validator** - Função que valida presença de letras, palavras, e texto em strings
|
157
157
|
|
158
158
|
## Release
|
159
|
-
Versão: **Beta 1.1.
|
159
|
+
Versão: **Beta 1.1.6**
|
160
160
|
|
161
161
|
Lançamento: *20/02/2024*
|
162
|
+
Última atualização: *09/09/2024*
|
162
163
|
|
163
164
|
Status: Em desenvolvimento.
|
164
165
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='rpa_suite',
|
5
|
-
version='1.1.
|
5
|
+
version='1.1.6',
|
6
6
|
packages=find_packages(),
|
7
7
|
description='Conjunto de ferramentas essenciais para Automação RPA com Python, que facilitam o dia a dia de desenvolvimento.',
|
8
8
|
long_description_content_type='text/markdown',
|
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
|
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
|