rpa-suite 1.3.7__tar.gz → 1.4.1__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.3.7 → rpa_suite-1.4.1}/PKG-INFO +3 -2
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/README.md +1 -1
- rpa_suite-1.4.1/rpa_suite/__init__.py +59 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/clock.py +30 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/date.py +30 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/dir.py +43 -1
- rpa_suite-1.4.1/rpa_suite/core/email.py +190 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/file.py +49 -1
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/log.py +161 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/print.py +32 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/regex.py +19 -1
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/validate.py +23 -1
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/suite.py +99 -1
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite.egg-info/PKG-INFO +3 -2
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite.egg-info/requires.txt +1 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/setup.py +2 -2
- rpa_suite-1.3.7/rpa_suite/__init__.py +0 -4
- rpa_suite-1.3.7/rpa_suite/core/email.py +0 -343
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/LICENSE +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/core/__init__.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/__create_log_dir.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/__create_ss_dir.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/__init__.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/_functions_logger.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/_logger.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/_printer.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/_variables.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite/functions/_variables_uru.py +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite.egg-info/SOURCES.txt +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite.egg-info/dependency_links.txt +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/rpa_suite.egg-info/top_level.txt +0 -0
- {rpa_suite-1.3.7 → rpa_suite-1.4.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: rpa_suite
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.4.1
|
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
|
@@ -24,6 +24,7 @@ Requires-Dist: email_validator
|
|
24
24
|
Requires-Dist: loguru
|
25
25
|
Requires-Dist: typing
|
26
26
|
Requires-Dist: pillow
|
27
|
+
Requires-Dist: pyautogui
|
27
28
|
Dynamic: author
|
28
29
|
Dynamic: author-email
|
29
30
|
Dynamic: classifier
|
@@ -185,7 +186,7 @@ Lançamento: *20/02/2024*
|
|
185
186
|
|
186
187
|
Status: Em desenvolvimento.
|
187
188
|
|
188
|
-
### Notas da atualização: 1.
|
189
|
+
### Notas da atualização: 1.4.1
|
189
190
|
|
190
191
|
- Correções de bugs em diversas funções relacionadas a tempo: *exec_at_hour* , *wait_for_exec* , *exec_and_wait*
|
191
192
|
- Correções de bugs com tempo superior a 10 minutos nas funções de data: *get_hms* e *get_dma*
|
@@ -148,7 +148,7 @@ Lançamento: *20/02/2024*
|
|
148
148
|
|
149
149
|
Status: Em desenvolvimento.
|
150
150
|
|
151
|
-
### Notas da atualização: 1.
|
151
|
+
### Notas da atualização: 1.4.1
|
152
152
|
|
153
153
|
- Correções de bugs em diversas funções relacionadas a tempo: *exec_at_hour* , *wait_for_exec* , *exec_and_wait*
|
154
154
|
- Correções de bugs com tempo superior a 10 minutos nas funções de data: *get_hms* e *get_dma*
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# rpa_suite/__init__.py
|
2
|
+
"""
|
3
|
+
RPA Suite is a Python module that provides a set of tools for process automation.
|
4
|
+
|
5
|
+
To use the module, import it as follows:
|
6
|
+
>>> from rpa_suite import rpa
|
7
|
+
|
8
|
+
Example of usage:
|
9
|
+
>>> from rpa_suite import rpa
|
10
|
+
>>> rpa.email.send_smtp(
|
11
|
+
... email_user="your@email.com",
|
12
|
+
... email_password="your_password",
|
13
|
+
... email_to="destination@email.com",
|
14
|
+
... subject_title="Test",
|
15
|
+
... body_message="<p>Test message</p>"
|
16
|
+
... )
|
17
|
+
>>> rpa.alert_print("Hello World")
|
18
|
+
|
19
|
+
Available modules:
|
20
|
+
``clock``: Utilities for time and stopwatch manipulation
|
21
|
+
``date``: Functions for date manipulation
|
22
|
+
``email``: Functionalities for sending emails via SMTP
|
23
|
+
``directory``: Operations with directories
|
24
|
+
``file``: File manipulation
|
25
|
+
``log``: Logging system
|
26
|
+
``printer``: Functions for formatted output
|
27
|
+
``regex``: Operations with regular expressions
|
28
|
+
``validate``: Data validation functions
|
29
|
+
|
30
|
+
pt-br
|
31
|
+
-----
|
32
|
+
RPA Suite é um módulo Python que fornece um conjunto de ferramentas para automação de processos.
|
33
|
+
|
34
|
+
Para utilizar o módulo, importe-o da seguinte forma:
|
35
|
+
>>> from rpa_suite import rpa
|
36
|
+
|
37
|
+
Exemplo de uso:
|
38
|
+
>>> from rpa_suite import rpa
|
39
|
+
>>> rpa.email.send_smtp(
|
40
|
+
... email_user="seu@email.com",
|
41
|
+
... email_password="sua_senha",
|
42
|
+
... email_to="destino@email.com",
|
43
|
+
... subject_title="Teste",
|
44
|
+
... body_message="<p>Mensagem de teste</p>"
|
45
|
+
... )
|
46
|
+
>>> rpa.alert_print("Hello World")
|
47
|
+
|
48
|
+
Módulos disponíveis:
|
49
|
+
``clock``: Utilitários para manipulação de tempo e cronômetro
|
50
|
+
``date``: Funções para manipulação de datas
|
51
|
+
``email``: Funcionalidades para envio de emails via SMTP
|
52
|
+
``directory``: Operações com diretórios
|
53
|
+
``file``: Manipulação de arquivos
|
54
|
+
``log``: Sistema de logging
|
55
|
+
``printer``: Funções para output formatado
|
56
|
+
``regex``: Operações com expressões regulares
|
57
|
+
``validate``: Funções de validação de dados
|
58
|
+
"""
|
59
|
+
from .suite import Suite as rpa
|
@@ -7,7 +7,37 @@ from typing import Callable, Any
|
|
7
7
|
|
8
8
|
|
9
9
|
class Clock():
|
10
|
+
"""
|
11
|
+
Class that provides utilities for time manipulation and stopwatch.
|
12
|
+
|
13
|
+
This class offers functionalities for:
|
14
|
+
- Timed function execution
|
15
|
+
- Execution time control
|
16
|
+
- Task scheduling
|
17
|
+
|
18
|
+
Methods:
|
19
|
+
exec_at_hour: Executes a function at a specific time
|
20
|
+
|
21
|
+
The Clock class is part of RPA Suite and can be accessed through the rpa object:
|
22
|
+
>>> from rpa_suite import rpa
|
23
|
+
>>> rpa.clock.exec_at_hour("14:30", my_function)
|
10
24
|
|
25
|
+
pt-br
|
26
|
+
----------
|
27
|
+
Classe que fornece utilitários para manipulação de tempo e cronômetro.
|
28
|
+
|
29
|
+
Esta classe oferece funcionalidades para:
|
30
|
+
- Execução temporizada de funções
|
31
|
+
- Controle de tempo de execução
|
32
|
+
- Agendamento de tarefas
|
33
|
+
|
34
|
+
Métodos:
|
35
|
+
exec_at_hour: Executa uma função em um horário específico
|
36
|
+
|
37
|
+
A classe Clock é parte do RPA Suite e pode ser acessada através do objeto rpa:
|
38
|
+
>>> from rpa_suite import rpa
|
39
|
+
>>> rpa.clock.exec_at_hour("14:30", minha_funcao)
|
40
|
+
"""
|
11
41
|
def __init__(self):
|
12
42
|
...
|
13
43
|
|
@@ -6,7 +6,37 @@ from typing import Tuple
|
|
6
6
|
from rpa_suite.functions._printer import error_print
|
7
7
|
|
8
8
|
class Date():
|
9
|
+
"""
|
10
|
+
Class that provides utilities for date manipulation and formatting.
|
9
11
|
|
12
|
+
This class offers functionalities for:
|
13
|
+
- Getting current time components (hours, minutes, seconds)
|
14
|
+
- Date formatting and manipulation
|
15
|
+
- Date validation and conversion
|
16
|
+
|
17
|
+
Methods:
|
18
|
+
get_hms: Returns current time as tuple of hour, minute, second
|
19
|
+
|
20
|
+
The Date class is part of RPA Suite and can be accessed through the rpa object:
|
21
|
+
>>> from rpa_suite import rpa
|
22
|
+
>>> hour, minute, second = rpa.date.get_hms()
|
23
|
+
|
24
|
+
pt-br
|
25
|
+
----------
|
26
|
+
Classe que fornece utilitários para manipulação e formatação de datas.
|
27
|
+
|
28
|
+
Esta classe oferece funcionalidades para:
|
29
|
+
- Obtenção de componentes do tempo atual (horas, minutos, segundos)
|
30
|
+
- Formatação e manipulação de datas
|
31
|
+
- Validação e conversão de datas
|
32
|
+
|
33
|
+
Métodos:
|
34
|
+
get_hms: Retorna o horário atual como tupla de hora, minuto, segundo
|
35
|
+
|
36
|
+
A classe Date é parte do RPA Suite e pode ser acessada através do objeto rpa:
|
37
|
+
>>> from rpa_suite import rpa
|
38
|
+
>>> hora, minuto, segundo = rpa.date.get_hms()
|
39
|
+
"""
|
10
40
|
def __init__(self):
|
11
41
|
...
|
12
42
|
|
@@ -5,7 +5,49 @@ from rpa_suite.functions._printer import error_print, alert_print, success_print
|
|
5
5
|
|
6
6
|
|
7
7
|
class Directory():
|
8
|
-
|
8
|
+
|
9
|
+
"""
|
10
|
+
Class that provides utilities for directory management, including creating, deleting, and manipulating directories.
|
11
|
+
|
12
|
+
This class offers functionalities for:
|
13
|
+
- Creating temporary directories
|
14
|
+
- Deleting directories
|
15
|
+
- Checking if a directory exists
|
16
|
+
- Listing files in a directory
|
17
|
+
|
18
|
+
Methods:
|
19
|
+
create_temp_dir: Creates a temporary directory for file operations.
|
20
|
+
|
21
|
+
The Directory class is part of RPA Suite and can be accessed through the rpa object:
|
22
|
+
>>> from rpa_suite import rpa
|
23
|
+
>>> rpa.directory.create_temp_dir(path_to_create='my_folder', name_temp_dir='temp_dir')
|
24
|
+
|
25
|
+
Parameters:
|
26
|
+
path_to_create (str): The full path where the temporary directory should be created. Default is 'default', which creates it in the current directory.
|
27
|
+
name_temp_dir (str): The name of the temporary directory to be created. Default is 'temp'.
|
28
|
+
|
29
|
+
pt-br
|
30
|
+
----------
|
31
|
+
Classe que fornece utilitários para gerenciamento de diretórios, incluindo criação, exclusão e manipulação de diretórios.
|
32
|
+
|
33
|
+
Esta classe oferece funcionalidades para:
|
34
|
+
- Criar diretórios temporários
|
35
|
+
- Excluir diretórios
|
36
|
+
- Verificar se um diretório existe
|
37
|
+
- Listar arquivos em um diretório
|
38
|
+
|
39
|
+
Métodos:
|
40
|
+
create_temp_dir: Cria um diretório temporário para operações com arquivos.
|
41
|
+
|
42
|
+
A classe Directory é parte do RPA Suite e pode ser acessada através do objeto rpa:
|
43
|
+
>>> from rpa_suite import rpa
|
44
|
+
>>> rpa.directory.create_temp_dir(path_to_create='minha_pasta', name_temp_dir='temp_dir')
|
45
|
+
|
46
|
+
Parâmetros:
|
47
|
+
path_to_create (str): O caminho completo onde o diretório temporário deve ser criado. O padrão é 'default', que o cria no diretório atual.
|
48
|
+
name_temp_dir (str): O nome do diretório temporário a ser criado. O padrão é 'temp'.
|
49
|
+
"""
|
50
|
+
|
9
51
|
def __init__(self):
|
10
52
|
...
|
11
53
|
|
@@ -0,0 +1,190 @@
|
|
1
|
+
# /sender_smtp.py
|
2
|
+
|
3
|
+
import smtplib, os
|
4
|
+
from email.mime.image import MIMEImage
|
5
|
+
from email.mime.multipart import MIMEMultipart
|
6
|
+
from email.mime.text import MIMEText
|
7
|
+
from email.mime.base import MIMEBase
|
8
|
+
from email import encoders
|
9
|
+
from rpa_suite.functions._printer import alert_print, error_print, success_print
|
10
|
+
from rpa_suite.core.validate import email_validator
|
11
|
+
|
12
|
+
|
13
|
+
class Email():
|
14
|
+
|
15
|
+
"""
|
16
|
+
Class that provides utilities for sending emails via SMTP protocol.
|
17
|
+
|
18
|
+
This class offers functionalities for:
|
19
|
+
- Sending emails with attachments
|
20
|
+
- HTML message formatting
|
21
|
+
- SMTP server configuration
|
22
|
+
- Email validation
|
23
|
+
|
24
|
+
Methods:
|
25
|
+
send_smtp: Sends an email through specified SMTP server
|
26
|
+
|
27
|
+
The Email class is part of RPA Suite and can be accessed through the rpa object:
|
28
|
+
>>> from rpa_suite import rpa
|
29
|
+
>>> rpa.email.send_smtp(
|
30
|
+
... email_user="your@email.com",
|
31
|
+
... email_password="your_password",
|
32
|
+
... email_to="destination@email.com",
|
33
|
+
... subject_title="Test",
|
34
|
+
... body_message="<p>Test message</p>"
|
35
|
+
... )
|
36
|
+
|
37
|
+
Parameters:
|
38
|
+
smtp_server (str): SMTP server address
|
39
|
+
smtp_port (str): SMTP server port
|
40
|
+
email_user (str): Email for SMTP authentication
|
41
|
+
email_password (str): Password for SMTP authentication
|
42
|
+
email_to (str): Recipient email address
|
43
|
+
attachments (list[str]): List of file paths to attach
|
44
|
+
subject_title (str): Email subject
|
45
|
+
body_message (str): Email body in HTML format
|
46
|
+
auth_tls (bool): Whether to use TLS authentication
|
47
|
+
|
48
|
+
pt-br
|
49
|
+
----------
|
50
|
+
Classe que fornece utilitários para envio de emails via protocolo SMTP.
|
51
|
+
|
52
|
+
Esta classe oferece funcionalidades para:
|
53
|
+
- Envio de emails com anexos
|
54
|
+
- Formatação de mensagens em HTML
|
55
|
+
- Configuração de servidor SMTP
|
56
|
+
- Validação de email
|
57
|
+
|
58
|
+
Métodos:
|
59
|
+
send_smtp: Envia um email através do servidor SMTP especificado
|
60
|
+
|
61
|
+
A classe Email é parte do RPA Suite e pode ser acessada através do objeto rpa:
|
62
|
+
>>> from rpa_suite import rpa
|
63
|
+
>>> rpa.email.send_smtp(
|
64
|
+
... email_user="seu@email.com",
|
65
|
+
... email_password="sua_senha",
|
66
|
+
... email_to="destino@email.com",
|
67
|
+
... subject_title="Teste",
|
68
|
+
... body_message="<p>Mensagem de teste</p>"
|
69
|
+
... )
|
70
|
+
"""
|
71
|
+
|
72
|
+
|
73
|
+
smtp_server:str = "smtp.hostinger.com",
|
74
|
+
smtp_port:str = 465,
|
75
|
+
email_user:str = "your_email@email.com",
|
76
|
+
email_password:str = "password",
|
77
|
+
email_to: str = "to@email.com",
|
78
|
+
attachments: list[str] = [],
|
79
|
+
subject_title: str = 'Test title',
|
80
|
+
body_message: str = '<p>Testing message body</p>'
|
81
|
+
auth_tls: bool = False,
|
82
|
+
|
83
|
+
|
84
|
+
def __init__(self):
|
85
|
+
...
|
86
|
+
|
87
|
+
def send_smtp(
|
88
|
+
self,
|
89
|
+
email_user:str,
|
90
|
+
email_password:str,
|
91
|
+
email_to: str,
|
92
|
+
subject_title: str = 'Test title',
|
93
|
+
body_message: str = '<p>Testing message body</p>',
|
94
|
+
attachments: list[str] = [],
|
95
|
+
smtp_server:str = "smtp.hostinger.com",
|
96
|
+
smtp_port:str = 465,
|
97
|
+
auth_tls: bool = False,
|
98
|
+
display_message: bool = True,
|
99
|
+
):
|
100
|
+
|
101
|
+
"""
|
102
|
+
Envia um e-mail utilizando o servidor SMTP especificado.
|
103
|
+
|
104
|
+
Args:
|
105
|
+
smtp_server (str, optional): Endereço do servidor SMTP.
|
106
|
+
Padrão: "smtp.hostinger.com".
|
107
|
+
smtp_port (str, optional): Porta do servidor SMTP.
|
108
|
+
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.
|
116
|
+
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.
|
120
|
+
Padrão: '<p>mensagem de teste</p>'.
|
121
|
+
|
122
|
+
Returns:
|
123
|
+
None: Esta função não retorna nenhum valor explicitamente, mas imprime mensagens de sucesso ou falha no envio do e-mail.
|
124
|
+
"""
|
125
|
+
|
126
|
+
try:
|
127
|
+
self.smtp_server = smtp_server
|
128
|
+
self.smtp_port = smtp_port
|
129
|
+
self.email_user = email_user
|
130
|
+
self.email_password = email_password
|
131
|
+
self.email_to = email_to
|
132
|
+
self.subject_title = subject_title
|
133
|
+
self.body_message = body_message
|
134
|
+
self.attachments = attachments
|
135
|
+
self.auth_tls = auth_tls
|
136
|
+
|
137
|
+
# Criando a mensagem
|
138
|
+
msg = MIMEMultipart()
|
139
|
+
msg['From'] = self.email_user
|
140
|
+
msg['To'] = ', '.join(self.email_to) if isinstance(self.email_to, list) else self.email_to
|
141
|
+
msg['Subject'] = str(self.subject_title)
|
142
|
+
|
143
|
+
# Corpo do e-mail
|
144
|
+
body = str(self.body_message)
|
145
|
+
msg.attach(MIMEText(body, 'html'))
|
146
|
+
|
147
|
+
# Anexos (opcional)
|
148
|
+
if self.attachments:
|
149
|
+
from email.mime.base import MIMEBase
|
150
|
+
from email import encoders
|
151
|
+
import os
|
152
|
+
|
153
|
+
for attachment_path in self.attachments:
|
154
|
+
try:
|
155
|
+
with open(attachment_path, "rb") as attachment:
|
156
|
+
part = MIMEBase("application", "octet-stream")
|
157
|
+
part.set_payload(attachment.read())
|
158
|
+
encoders.encode_base64(part)
|
159
|
+
part.add_header(
|
160
|
+
"Content-Disposition",
|
161
|
+
f"attachment; filename= {os.path.basename(attachment_path)}",
|
162
|
+
)
|
163
|
+
msg.attach(part)
|
164
|
+
|
165
|
+
except Exception as e:
|
166
|
+
error_print(f"Erro ao anexar o arquivo {attachment_path}: {str(e)}")
|
167
|
+
|
168
|
+
try:
|
169
|
+
if self.auth_tls:
|
170
|
+
# Conectando ao servidor SMTP com TLS
|
171
|
+
server = smtplib.SMTP(self.smtp_server, self.smtp_port)
|
172
|
+
server.starttls()
|
173
|
+
server.login(self.email_user, self.email_password)
|
174
|
+
else:
|
175
|
+
# Conectando ao servidor SMTP com SSL
|
176
|
+
server = smtplib.SMTP_SSL(self.smtp_server, self.smtp_port)
|
177
|
+
server.login(self.email_user, self.email_password)
|
178
|
+
|
179
|
+
# Enviando o e-mail
|
180
|
+
server.sendmail(self.email_user, self.email_to, msg.as_string())
|
181
|
+
if display_message: success_print("E-mail enviado com sucesso!")
|
182
|
+
|
183
|
+
# Encerrando a conexão
|
184
|
+
server.quit()
|
185
|
+
|
186
|
+
except Exception as e:
|
187
|
+
alert_print(f"Falha ao enviar o e-mail: {str(e)}")
|
188
|
+
|
189
|
+
except Exception as e:
|
190
|
+
error_print(f"Ocorreu um erro geral na função sendmail: {str(e)}")
|
@@ -6,7 +6,55 @@ from colorama import Fore
|
|
6
6
|
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.
|
11
|
+
|
12
|
+
This class offers functionalities for:
|
13
|
+
- Creating files
|
14
|
+
- Deleting files
|
15
|
+
- Reading and writing file content
|
16
|
+
- File path management
|
17
|
+
|
18
|
+
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
|
23
|
+
|
24
|
+
The File class is part of RPA Suite and can be accessed through the rpa object:
|
25
|
+
>>> from rpa_suite import rpa
|
26
|
+
>>> rpa.file.create_file('example.txt', 'Hello, World!')
|
27
|
+
|
28
|
+
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
|
32
|
+
|
33
|
+
pt-br
|
34
|
+
----------
|
35
|
+
Classe que fornece utilitários para gerenciamento de arquivos, incluindo criação, exclusão e manipulação de arquivos.
|
36
|
+
|
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
|
42
|
+
|
43
|
+
Métodos:
|
44
|
+
create_file: Cria um novo arquivo com o conteúdo especificado
|
45
|
+
delete_file: Exclui um arquivo especificado
|
46
|
+
read_file: Lê o conteúdo de um arquivo especificado
|
47
|
+
write_file: Escreve conteúdo em um arquivo especificado
|
48
|
+
|
49
|
+
A classe File é parte do RPA Suite e pode ser acessada através do objeto rpa:
|
50
|
+
>>> from rpa_suite import rpa
|
51
|
+
>>> rpa.file.create_file('exemplo.txt', 'Olá, Mundo!')
|
52
|
+
|
53
|
+
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
|
57
|
+
"""
|
10
58
|
def __init__(self):
|
11
59
|
self.__create_ss_dir = create_ss_dir
|
12
60
|
|