rpa-suite 1.4.1__py3-none-any.whl → 1.4.2__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/__init__.py CHANGED
@@ -56,4 +56,5 @@
56
56
  ``regex``: Operações com expressões regulares
57
57
  ``validate``: Funções de validação de dados
58
58
  """
59
- from .suite import Suite as rpa
59
+
60
+ from .suite import Suite as rpa
@@ -1 +1,27 @@
1
- # rpa_suite/core/__init__.py
1
+ # rpa_suite/core/__init__.py
2
+
3
+ """
4
+ The Core module is where we can import all Sub-Objects used by the rpa_suite module separately, categorized by their respective classes based on functionality. However, we can also use them through the main rpa object using the following syntax:
5
+ >>> from rpa_suite import rpa
6
+ >>> rpa.clock.wait_for_exec()
7
+ >>> rpa.file.screen_shot() ...
8
+ among others.
9
+
10
+ pt-br
11
+ ----------
12
+ O módulo Core é de onde podemos importar todos os Sub-Objetos usados pelo módulo rpa_suite de forma separada, categorizados por suas respectivas classes com base na funcionalidade. No entanto, também podemos usá-los através do objeto principal rpa usando a seguinte sintaxe:
13
+ >>> from rpa_suite import rpa
14
+ >>> rpa.clock.wait_for_exec()
15
+ >>> rpa.file.screen_shot() ...
16
+ entre outros.
17
+
18
+ """
19
+ from .clock import Clock
20
+ from .date import Date
21
+ from .dir import Directory
22
+ from .email import Email
23
+ from .file import File
24
+ from .log import Log
25
+ from .print import Print
26
+ from .regex import Regex
27
+ from .validate import Validate
rpa_suite/core/clock.py CHANGED
@@ -7,6 +7,7 @@ from typing import Callable, Any
7
7
 
8
8
 
9
9
  class Clock():
10
+
10
11
  """
11
12
  Class that provides utilities for time manipulation and stopwatch.
12
13
 
@@ -38,11 +39,12 @@ class Clock():
38
39
  >>> from rpa_suite import rpa
39
40
  >>> rpa.clock.exec_at_hour("14:30", minha_funcao)
40
41
  """
42
+
41
43
  def __init__(self):
42
44
  ...
43
-
45
+
44
46
  def exec_at_hour(self,
45
- hour_to_exec: str,
47
+ hour_to_exec: str | None,
46
48
  fn_to_exec: Callable[..., Any],
47
49
  *args,
48
50
  **kwargs,
@@ -190,7 +192,8 @@ class Clock():
190
192
  >>> wait_for_exec(30, sum, 10, 5) -> 15 \n
191
193
  * NOTE: `wait_for_exec` receives as first argument the time to wait (sec), then the function `sum` and finally the arguments that the function will use.
192
194
 
193
- Description: pt-br
195
+
196
+ pt-br
194
197
  ----------
195
198
  Função temporizadora, aguardar um valor em ``segundos`` para executar a função do argumento.
196
199
 
@@ -257,8 +260,9 @@ class Clock():
257
260
  We have a sum function in the following format ``sum(a, b) -> return x``, where ``x`` is the result of the sum. We want to execute the sum and then wait `30 seconds` to continue the main code:
258
261
  >>> wait_for_exec(30, sum, 10, 5) -> 15 \n
259
262
  * NOTE: `wait_for_exec` receives as first argument the time to wait (sec), then the function `sum` and finally the arguments that the function will use.
260
-
261
- Description: pt-br
263
+
264
+
265
+ pt-br
262
266
  ----------
263
267
  Função temporizadora, executa uma função e aguarda o tempo em ``segundos``
264
268
 
rpa_suite/core/email.py CHANGED
@@ -99,28 +99,54 @@ class Email():
99
99
  ):
100
100
 
101
101
  """
102
- Envia um e-mail utilizando o servidor SMTP especificado.
102
+ Sends an email using the specified SMTP server.
103
103
 
104
104
  Args:
105
- smtp_server (str, optional): Endereço do servidor SMTP.
105
+ smtp_server (str, optional): Address of the SMTP server.
106
+ Default: "smtp.hostinger.com".
107
+ smtp_port (str, optional): Port of the SMTP server.
108
+ Default: 465.
109
+ email_user (str, optional): User (email) for authentication on the SMTP server.
110
+ Default: "example@email.com".
111
+ email_password (str, optional): Password for authentication on the SMTP server.
112
+ Default: "example123".
113
+ email_to (str, optional): Email address of the recipient.
114
+ Default: "person@email.com".
115
+ attachments (list[str], optional): List of file paths to attach to the email.
116
+ Default: [].
117
+ subject_title (str, optional): Title (subject) of the email.
118
+ Default: 'test title'.
119
+ body_message (str, optional): Body of the email message, in HTML format.
120
+ Default: '<p>test message</p>'.
121
+
122
+ Returns:
123
+ None: This function does not explicitly return any value, but prints success or failure messages when sending the email.
124
+
125
+ pt-br
126
+ ------
127
+
128
+ Envia um email usando o servidor SMTP especificado.
129
+
130
+ Args:
131
+ smtp_server (str, opcional): Endereço do servidor SMTP.
106
132
  Padrão: "smtp.hostinger.com".
107
- smtp_port (str, optional): Porta do servidor SMTP.
133
+ smtp_port (str, opcional): Porta do servidor SMTP.
108
134
  Padrão: 465.
109
- email_user (str, optional): Usuário (e-mail) para autenticação no servidor SMTP.
110
- Padrão: "bot@vettracode.com".
111
- email_password (str, optional): Senha para autenticação no servidor SMTP.
112
- Padrão: "Bot@#2025".
113
- email_to (str, optional): Endereço de e-mail do destinatário.
114
- Padrão: "camilo.costa1993@gmail.com".
115
- attachments (list[str], optional): Lista de caminhos de arquivos para anexar ao e-mail.
135
+ email_user (str, opcional): Usuário (email) para autenticação no servidor SMTP.
136
+ Padrão: "example@email.com".
137
+ email_password (str, opcional): Senha para autenticação no servidor SMTP.
138
+ Padrão: "example123".
139
+ email_to (str, opcional): Endereço de email do destinatário.
140
+ Padrão: "person@email.com".
141
+ attachments (list[str], opcional): Lista de caminhos de arquivos para anexar ao email.
116
142
  Padrão: [].
117
- subject_title (str, optional): Título (assunto) do e-mail.
118
- Padrão: 'titulo teste'.
119
- body_message (str, optional): Corpo da mensagem do e-mail, em formato HTML.
143
+ subject_title (str, opcional): Título (assunto) do email.
144
+ Padrão: 'título de teste'.
145
+ body_message (str, opcional): Corpo da mensagem do email, em formato HTML.
120
146
  Padrão: '<p>mensagem de teste</p>'.
121
147
 
122
148
  Returns:
123
- None: Esta função não retorna nenhum valor explicitamente, mas imprime mensagens de sucesso ou falha no envio do e-mail.
149
+ Nenhum: Esta função não retorna explicitamente nenhum valor, mas imprime mensagens de sucesso ou falha ao enviar o email.
124
150
  """
125
151
 
126
152
  try:
rpa_suite/core/file.py CHANGED
@@ -7,54 +7,55 @@ from typing import Dict, List, Union
7
7
 
8
8
  class File():
9
9
  """
10
- Class that provides utilities for file management, including creating, deleting, and manipulating files.
10
+ Class that provides utilities for file management, including creation, deletion, and manipulation of files.
11
11
 
12
12
  This class offers functionalities for:
13
- - Creating files
14
- - Deleting files
15
- - Reading and writing file content
16
- - File path management
13
+ - Creating and deleting flag files
14
+ - Counting files in a directory
15
+ - Capturing screenshots and managing their paths
17
16
 
18
17
  Methods:
19
- create_file: Creates a new file with specified content
20
- delete_file: Deletes a specified file
21
- read_file: Reads content from a specified file
22
- write_file: Writes content to a specified file
18
+ screen_shot: Creates a screenshot and saves it in a specified directory
19
+ count_files: Counts the number of files in a specified directory
20
+ flag_create: Creates a flag file
21
+ flag_delete: Deletes a flag file
23
22
 
24
- The File class is part of RPA Suite and can be accessed through the rpa object:
23
+ The File class is part of the RPA Suite and can be accessed through the rpa object:
25
24
  >>> from rpa_suite import rpa
26
- >>> rpa.file.create_file('example.txt', 'Hello, World!')
25
+ >>> rpa.file.screen_shot('example')
27
26
 
28
27
  Parameters:
29
- file_name (str): The name of the file to be created or manipulated
30
- content (str): The content to be written to the file
31
- path (str): The directory path where the file should be created or deleted
28
+ file_name (str): The name of the screenshot file
29
+ path_dir (str): The path of the directory where the screenshot should be saved
30
+ save_with_date (bool): Indicates if the file name should include the date
31
+ delay (int): The wait time before capturing the screen
32
32
 
33
33
  pt-br
34
34
  ----------
35
35
  Classe que fornece utilitários para gerenciamento de arquivos, incluindo criação, exclusão e manipulação de arquivos.
36
36
 
37
37
  Esta classe oferece funcionalidades para:
38
- - Criar arquivos
39
- - Excluir arquivos
40
- - Ler e escrever conteúdo de arquivos
41
- - Gerenciamento de caminhos de arquivos
38
+ - Criar e excluir arquivos de flag
39
+ - Contar arquivos em um diretório
40
+ - Capturar screenshots e gerenciar seus caminhos
42
41
 
43
42
  Métodos:
44
- create_file: Cria um novo arquivo com o conteúdo especificado
45
- delete_file: Exclui um arquivo especificado
46
- read_file: o conteúdo de um arquivo especificado
47
- write_file: Escreve conteúdo em um arquivo especificado
43
+ screen_shot: Cria uma captura de tela e a salva em um diretório especificado
44
+ count_files: Conta o número de arquivos em um diretório especificado
45
+ flag_create: Cria um arquivo de flag
46
+ flag_delete: Exclui um arquivo de flag
48
47
 
49
48
  A classe File é parte do RPA Suite e pode ser acessada através do objeto rpa:
50
49
  >>> from rpa_suite import rpa
51
- >>> rpa.file.create_file('exemplo.txt', 'Olá, Mundo!')
50
+ >>> rpa.file.screen_shot('exemplo')
52
51
 
53
52
  Parâmetros:
54
- file_name (str): O nome do arquivo a ser criado ou manipulado
55
- content (str): O conteúdo a ser escrito no arquivo
56
- path (str): O caminho do diretório onde o arquivo deve ser criado ou excluído
53
+ file_name (str): O nome do arquivo de captura de tela
54
+ path_dir (str): O caminho do diretório onde a captura de tela deve ser salva
55
+ save_with_date (bool): Indica se o nome do arquivo deve incluir a data
56
+ delay (int): O tempo de espera antes de capturar a tela
57
57
  """
58
+
58
59
  def __init__(self):
59
60
  self.__create_ss_dir = create_ss_dir
60
61
 
@@ -64,7 +65,7 @@ class File():
64
65
  save_with_date: bool = True,
65
66
  delay: int = 1,
66
67
  use_default_path_and_name: bool = True,
67
- name_ss_dir:str = None,
68
+ name_ss_dir:str | None = None,
68
69
  display_message: bool = False) -> str | None:
69
70
 
70
71
  """
@@ -72,10 +73,13 @@ class File():
72
73
 
73
74
  Parameters:
74
75
  ----------
75
- ``file_path: str`` - should be a string, not have a default path.
76
76
  ``file_name: str`` - should be a string, by default name is `screenshot`.
77
+ ``path_dir: str`` - should be a string, not have a default path.
77
78
  ``save_with_date: bool`` - should be a boolean, by default `True` save namefile with date `foo_dd_mm_yyyy-hh_mm_ss.png`.
78
79
  ``delay: int`` - should be a int, by default 1 (represents seconds).
80
+ ``use_default_path_and_name: bool`` - should be a boolean, by default `True`
81
+ ``name_ss_dir: str`` - should be a string, by default type `None`
82
+ ``display_message`` - should be a boolean, by default `False`
79
83
 
80
84
  Return:
81
85
  ----------
@@ -88,10 +92,13 @@ class File():
88
92
 
89
93
  Parâmetros:
90
94
  ----------
91
- ``file_path: str`` - deve ser uma string, não tem um caminho padrão.
92
95
  ``file_name: str`` - deve ser uma string, por padrão o nome é `screenshot`.
96
+ ``file_path: str`` - deve ser uma string, não tem um caminho padrão.
93
97
  ``save_with_date: bool`` - deve ser um booleano, por padrão `True` salva o nome do arquivo com a data `foo_dd_mm_yyyy-hh_mm_ss.png`.
94
98
  ``delay: int`` - deve ser um int, por padrão 1 representado em segundo(s).
99
+ ``use_default_path_and_name: bool`` - deve ser um booleano, por padrão `True`
100
+ ``name_ss_dir: str`` - deve ser uma string, por padrão do tipo `None`
101
+ ``display_message`` - deve ser um booleano, por padrão `False`
95
102
 
96
103
  Retorno:
97
104
  ----------
@@ -149,7 +156,7 @@ class File():
149
156
 
150
157
  def flag_create(self,
151
158
  name_file: str = 'running.flag',
152
- path_to_create: str = None,
159
+ path_to_create: str | None = None,
153
160
  display_message: bool = True) -> None:
154
161
  """
155
162
  Cria um arquivo de sinalização indicando que o robô está em execução.
@@ -172,7 +179,7 @@ class File():
172
179
 
173
180
  def flag_delete(self,
174
181
  name_file: str = 'running.flag',
175
- path_to_delete: str = None,
182
+ path_to_delete: str | None = None,
176
183
  display_message: bool = True,) -> None:
177
184
 
178
185
  """
@@ -241,7 +248,7 @@ class File():
241
248
  # Process
242
249
  try:
243
250
  for dir in dir_to_count:
244
- for current_dir, sub_dir, files in os.walk(dir):
251
+ for _, _, files in os.walk(dir):
245
252
  for file in files:
246
253
  if type_extension == '*' or file.endswith(f'.{type_extension}'):
247
254
  result['qt'] += 1
rpa_suite/suite.py CHANGED
@@ -9,6 +9,7 @@ from .core.regex import Regex
9
9
  from .core.validate import Validate
10
10
  from colorama import Fore
11
11
 
12
+
12
13
  # Windows bash colors
13
14
  class Colors():
14
15
 
@@ -134,8 +135,6 @@ class Suite():
134
135
  def __init__(self):
135
136
  ...
136
137
 
137
-
138
-
139
138
  def success_print(self,
140
139
  string_text: str,
141
140
  color=Colors.green,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rpa_suite
3
- Version: 1.4.1
3
+ Version: 1.4.2
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
@@ -186,7 +186,7 @@ Lançamento: *20/02/2024*
186
186
 
187
187
  Status: Em desenvolvimento.
188
188
 
189
- ### Notas da atualização: 1.4.1
189
+ ### Notas da atualização: 1.4.2
190
190
 
191
191
  - Correções de bugs em diversas funções relacionadas a tempo: *exec_at_hour* , *wait_for_exec* , *exec_and_wait*
192
192
  - Correções de bugs com tempo superior a 10 minutos nas funções de data: *get_hms* e *get_dma*
@@ -1,11 +1,11 @@
1
- rpa_suite/__init__.py,sha256=FltmvZSoiSq67rk1Oq1dMdrO-lOgHDidhkF7WPm4ybE,2297
2
- rpa_suite/suite.py,sha256=nZxXonIVFNdJo7EFoCfhc7lZA_svz0DBoApeca_bDCo,10120
3
- rpa_suite/core/__init__.py,sha256=VROMsrhKGMqUlstH8cEqp5fwRVC12d3U3_XoxoKOzyg,28
4
- rpa_suite/core/clock.py,sha256=DlKSSG9W0SG4mtpbmxh3-OMsSBg8ZqMyn9gBxEF-tvI,13799
1
+ rpa_suite/__init__.py,sha256=BDRCB6CggcWSh2wOgPuxL5iPDRRYuPibTaEG7eLMyhc,2297
2
+ rpa_suite/suite.py,sha256=WnCJ-AZ99NxnoS10E7_qX_0eg886B2IDekj6Cl1HFVA,10110
3
+ rpa_suite/core/__init__.py,sha256=1XkytWVpVwyP8Dmm4UsXE625P5i7MOOXJBsQOPfCqiE,1046
4
+ rpa_suite/core/clock.py,sha256=sTaYknZo46-L199k3utQdJ2b2IyL7FEkQu_dgwbdVMo,13800
5
5
  rpa_suite/core/date.py,sha256=PBU999Acxiwoep029ElqKSzK6T4DrF3eIP-LB_J-BbM,6568
6
6
  rpa_suite/core/dir.py,sha256=y6YDyRYQdf9Bj0z3Gs6ugNZ0tKWYgWdDI5R5BjjRIEY,9783
7
- rpa_suite/core/email.py,sha256=0bK70FSzsWhe2UvTHlnW_o9-c2rX7Beugr2kt2TXTwM,7429
8
- rpa_suite/core/file.py,sha256=AdpktNTXvHTsRHhm0F1JdG7xDsYvRCv_6j2vZubxqss,10945
7
+ rpa_suite/core/email.py,sha256=kQJAc6Nb9y7jo-oBAo8X1EZS2y-_gTJRoRc9ylS04CE,8675
8
+ rpa_suite/core/file.py,sha256=xuXaV_jon8hJ1Fb2j5DukXfnAzZRmtFgVJhTQs8dptU,11572
9
9
  rpa_suite/core/log.py,sha256=cfnThg3cKCRZ4InXPSThKNVuHbN6c06l3wilU0NuDck,17802
10
10
  rpa_suite/core/print.py,sha256=tLHIKo6LDTrV91gWKvwlTrxb1idgx3EV_fIRkqtzWBM,6389
11
11
  rpa_suite/core/regex.py,sha256=wsTxe8-baKul2Fv1-fycXZ-DVa5krhkc9qMkP04giGs,3303
@@ -18,8 +18,8 @@ rpa_suite/functions/_logger.py,sha256=gTYO9JlbX5_jDfu_4FTTajJw3_GotE2BHUbDDB1Hf5
18
18
  rpa_suite/functions/_printer.py,sha256=r72zeobAi2baVbYgbfFH0h5-WMv4tSDGPNlcpZen7O0,3949
19
19
  rpa_suite/functions/_variables.py,sha256=vCcktifFUriBQTyUaayZW8BlE8Gr7VP-tFbfomKOS5U,312
20
20
  rpa_suite/functions/_variables_uru.py,sha256=xRqYp49l1fFNrHczOmJ6Pqw1PKIWs0f9kxlgvuYGYys,303
21
- rpa_suite-1.4.1.dist-info/licenses/LICENSE,sha256=5D8PIbs31iGd9i1_MDNg4SzaQnp9sEIULALh2y3WyMI,1102
22
- rpa_suite-1.4.1.dist-info/METADATA,sha256=gnpgfEeLIbREvsy37hvOwzPV5HzqZ0TbhAKM9zpqYT8,9351
23
- rpa_suite-1.4.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
24
- rpa_suite-1.4.1.dist-info/top_level.txt,sha256=HYkDtg-kJNAr3F2XAIPyJ-QBbNhk7q6jrqsFt10lz4Y,10
25
- rpa_suite-1.4.1.dist-info/RECORD,,
21
+ rpa_suite-1.4.2.dist-info/licenses/LICENSE,sha256=5D8PIbs31iGd9i1_MDNg4SzaQnp9sEIULALh2y3WyMI,1102
22
+ rpa_suite-1.4.2.dist-info/METADATA,sha256=Tin3NzbSIPyO5n2MYjC7GExxMDIeyhm6UPi1H9iL0N8,9351
23
+ rpa_suite-1.4.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
24
+ rpa_suite-1.4.2.dist-info/top_level.txt,sha256=HYkDtg-kJNAr3F2XAIPyJ-QBbNhk7q6jrqsFt10lz4Y,10
25
+ rpa_suite-1.4.2.dist-info/RECORD,,