rpa-suite 1.5.9__py3-none-any.whl → 1.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/__init__.py CHANGED
@@ -27,7 +27,10 @@ Available modules:
27
27
  ``printer``: Functions for formatted output
28
28
  ``regex``: Operations with regular expressions
29
29
  ``validate``: Data validation functions
30
+ ``ParallelRunner``: Object ParallelRunner functions to run in parallel
31
+ ``AsyncRunner``: Object AsyncRunner functions to run in Assyncronous
30
32
  ``Browser``: Object Browser automation functions (neeeds Selenium and Webdriver_Manager)
33
+ ``Iris``: Object Iris automation functions to convert documents with OCR + IA based on ``docling``
31
34
 
32
35
  pt-br
33
36
  -----
@@ -57,10 +60,13 @@ Módulos disponíveis:
57
60
  ``printer``: Funções para output formatado
58
61
  ``regex``: Operações com expressões regulares
59
62
  ``validate``: Funções de validação de dados
63
+ ``ParallelRunner``: Objeto ParallelRunner funções para rodar processos em paralelo
64
+ ``AsyncRunner``: Objeto AsyncRunner funções para rodar processos em assincronicidade
60
65
  ``Browser``: Objeto de Automação de Navegadores (necessario Selenium e Webdriver_Manager)
66
+ ``Iris``: Objeto Iris Automação de funções para converter documentos com OCR + IA baseado em ``docling``
61
67
  """
62
68
 
63
- __version__ = "1.5.5"
69
+ __version__ = "1.6.1"
64
70
 
65
71
  # allows importing the rpa_suite module without the package name
66
72
  from .suite import rpa
@@ -36,13 +36,16 @@ from .parallel import ParallelRunner
36
36
  from .asyncrun import AsyncRunner
37
37
 
38
38
 
39
- # On this case, we are importing the Browser class only if the selenium and webdriver_manager modules are installed.
40
- # This is useful to avoid unnecessary imports and dependencies if the user does not need the Browser functionality.
39
+ # On this case, we are importing the (Browser|Iris) class only if the (selenium and webdriver_manager| docling) modules are installed.
40
+ # This is useful to avoid unnecessary imports and dependencies if the user does not need the (Browser|Iris) functionality.
41
41
  import importlib.util
42
42
 
43
43
  # from .browser import Browser
44
44
  if importlib.util.find_spec("selenium") and importlib.util.find_spec("webdriver_manager"):
45
45
  from .browser import Browser
46
46
 
47
+ # from .iris import Iris
48
+ if importlib.util.find_spec("docling"):
49
+ from .iris import Iris
47
50
 
48
- __version__ = "1.5.5"
51
+ __version__ = "1.6.1"
rpa_suite/core/iris.py ADDED
@@ -0,0 +1,140 @@
1
+ # rpa_suite/core/iris.py
2
+
3
+ """
4
+ Iris (OCR-IA) módulo para conversão de documentos usando DocLing.
5
+
6
+ Este módulo fornece uma interface simplificada para converter documentos
7
+ em vários formatos, otimizado para uso em automação RPA.
8
+ """
9
+
10
+ # imports externos
11
+ try:
12
+ from docling.document_converter import DocumentConverter
13
+ except ImportError as e:
14
+ raise ImportError("Iris - Error: Não foi possível importar 'docling.document_converter'. Certifique-se de que a biblioteca 'docling' está instalada.") from e
15
+
16
+ # imports de terceiros
17
+ from enum import Enum
18
+ from pathlib import Path
19
+ from typing import Any, Dict, List, Optional, Union
20
+
21
+ # imports internos
22
+ from rpa_suite.functions._printer import alert_print, error_print, success_print
23
+
24
+ class IrisError(Exception):
25
+ """Exceção personalizada para erros do Iris."""
26
+ def __init__(self, message):
27
+ super().__init__(f'Iris - Error: {message}')
28
+
29
+ class ExportFormats(Enum):
30
+ """Formatos de exportação suportados para conversão de documentos."""
31
+ MARKDOWN = "markdown"
32
+ DICT = "dict"
33
+ DOCTAGS = "doctags"
34
+ HTML = "html"
35
+ TEXT = "text"
36
+
37
+ class Iris:
38
+ """
39
+ Iris (OCR-IA)
40
+ Conversor de documentos usando a biblioteca DocLing.
41
+
42
+ Esta classe fornece uma interface simplificada para converter documentos
43
+ em vários formatos (PDF, imagens, texto) para formatos estruturados como
44
+ Markdown, HTML, texto simples, entre outros.
45
+
46
+ Atributos:
47
+ engine: Instância do DocumentConverter do DocLing.
48
+ last_result: Último resultado de conversão processado.
49
+
50
+ Exemplo:
51
+ >>> iris = Iris()
52
+ >>> content = iris.read_document("document.pdf", ExportFormats.MARKDOWN)
53
+ >>> print(content)
54
+ """
55
+
56
+ engine: Optional[DocumentConverter]
57
+
58
+ def __init__(self) -> None:
59
+ """
60
+ Inicializa a classe Iris com o conversor de documentos.
61
+
62
+ Levanta:
63
+ IrisError: Se a biblioteca DocLing não estiver instalada.
64
+ """
65
+ try:
66
+ self.iris_converter = DocumentConverter()
67
+ self.engine = self.iris_converter
68
+ self.path_file = None
69
+ self.result_converted = None
70
+ self.result_formatted = None
71
+ except Exception as e:
72
+ error_print("Iris - Error: Falha ao inicializar o DocumentConverter.")
73
+ raise IrisError(f"Falha ao inicializar o DocumentConverter: {e}")
74
+
75
+ def __convert_document(self, path_file: str = None):
76
+ """
77
+ Converte o documento informado pelo caminho.
78
+
79
+ Levanta:
80
+ IrisError: Se ocorrer erro na conversão do documento.
81
+ """
82
+ try:
83
+ if not path_file:
84
+ raise IrisError("Caminho do arquivo não informado para conversão.")
85
+ self.result_converted = self.iris_converter.convert(path_file)
86
+ except Exception as e:
87
+ error_print(f"Iris - Error: Falha ao converter o documento: {e}")
88
+ raise IrisError(f"Falha ao converter o documento: {e}")
89
+
90
+ def read_document(self, file_path: str = None, result_format=ExportFormats.MARKDOWN, verbose: bool = False) -> Optional[Union[str, dict]]:
91
+ """
92
+ Lê e converte um documento para o formato especificado.
93
+
94
+ Args:
95
+ file_path: Caminho para o arquivo do documento.
96
+ result_format: Formato de exportação desejado.
97
+ verbose: Se True, exibe mensagens de sucesso.
98
+
99
+ Retorna:
100
+ Documento convertido para o formato especificado, ou None se falhar.
101
+
102
+ Levanta:
103
+ IrisError: Se ocorrer erro durante validação, conversão ou exportação.
104
+
105
+ Exemplo:
106
+ >>> iris = Iris()
107
+ >>> content = iris.read_document("doc.pdf", ExportFormats.TEXT)
108
+ >>> print(content)
109
+ """
110
+ try:
111
+ self.__convert_document(file_path)
112
+
113
+ if not self.result_converted or not hasattr(self.result_converted, 'document'):
114
+ raise IrisError("Conversão falhou ou objeto retornado inválido.")
115
+
116
+ if result_format == ExportFormats.MARKDOWN:
117
+ self.result_formatted = self.result_converted.document.export_to_markdown()
118
+ elif result_format == ExportFormats.DICT:
119
+ self.result_formatted = self.result_converted.document.export_to_dict()
120
+ elif result_format == ExportFormats.DOCTAGS:
121
+ self.result_formatted = self.result_converted.document.export_to_doctags()
122
+ elif result_format == ExportFormats.HTML:
123
+ self.result_formatted = self.result_converted.document.export_to_html()
124
+ elif result_format == ExportFormats.TEXT:
125
+ self.result_formatted = self.result_converted.document.export_to_text()
126
+ else:
127
+ alert_print(f'Iris - Error: Formato não suportado: {result_format}.')
128
+ raise IrisError(f"Formato não suportado: {result_format}.")
129
+
130
+ if verbose:
131
+ success_print('Irir - Convertido com sucesso!')
132
+
133
+ return self.result_formatted
134
+
135
+ except IrisError as ie:
136
+ error_print(str(ie))
137
+ return None
138
+ except Exception as e:
139
+ error_print(f"Iris - Error: Erro inesperado ao ler o documento: {e}")
140
+ raise IrisError(f"Erro inesperado ao ler o documento: {e}")
@@ -1,3 +1,3 @@
1
1
  # rpa_suite/functions/__init__.py
2
2
 
3
- __version__ = "1.5.5"
3
+ __version__ = "1.6.1"
rpa_suite/suite.py CHANGED
@@ -13,7 +13,6 @@ from .core.validate import Validate
13
13
  from .core.parallel import ParallelRunner
14
14
  from .core.asyncrun import AsyncRunner
15
15
 
16
-
17
16
  # imports external
18
17
  from colorama import Fore
19
18
  from importlib.metadata import version
@@ -104,6 +103,10 @@ class Suite:
104
103
  ``printer``: Functions for formatted output
105
104
  ``regex``: Operations with regular expressions
106
105
  ``validate``: Data validation functions
106
+ ``ParallelRunner``: Object ParallelRunner functions to run in parallel
107
+ ``AsyncRunner``: Object AsyncRunner functions to run in Assyncronous
108
+ ``Browser``: Object Browser automation functions (neeeds Selenium and Webdriver_Manager)
109
+ ``Iris``: Object Iris automation functions to convert documents with OCR + IA based on ``docling``
107
110
 
108
111
  pt-br
109
112
  -----
@@ -133,6 +136,10 @@ class Suite:
133
136
  ``printer``: Funções para output formatado
134
137
  ``regex``: Operações com expressões regulares
135
138
  ``validate``: Funções de validação de dados
139
+ ``ParallelRunner``: Objeto ParallelRunner funções para rodar processos em paralelo
140
+ ``AsyncRunner``: Objeto AsyncRunner funções para rodar processos em assincronicidade
141
+ ``Browser``: Objeto de Automação de Navegadores (necessario Selenium e Webdriver_Manager)
142
+ ``Iris``: Objeto Iris Automação de funções para converter documentos com OCR + IA baseado em ``docling``
136
143
  """
137
144
 
138
145
  # SUBMODULES
@@ -148,8 +155,9 @@ class Suite:
148
155
  Parallel: ParallelRunner = ParallelRunner
149
156
  Asyn: AsyncRunner = AsyncRunner
150
157
 
151
- # On this case, we are importing the Browser class only if the selenium and webdriver_manager modules are installed.
152
- # This is useful to avoid unnecessary imports and dependencies if the user does not need the Browser functionality.
158
+
159
+ # On this case, we are importing the (Browser | Iris) class only if the (selenium and webdriver_manager| docling) modules are installed.
160
+ # This is useful to avoid unnecessary imports and dependencies if the user does not need the (Browser | Iris) functionality.
153
161
  import importlib.util
154
162
 
155
163
  # from .browser import Browser
@@ -158,6 +166,12 @@ class Suite:
158
166
 
159
167
  browser: Browser = Browser
160
168
 
169
+ # from .iris import Iris
170
+ if importlib.util.find_spec("docling"):
171
+ from .core.iris import Iris
172
+
173
+ iris: Iris = Iris
174
+
161
175
  # VARIABLES INTERNAL
162
176
  try:
163
177
  # old: __version__ = pkg_resources.get_distribution("rpa_suite").version
@@ -312,10 +326,16 @@ class Suite:
312
326
 
313
327
  def __install_all_libs(self):
314
328
  """
329
+ Method responsible for installing all libraries for advanced use of RPA-Suite, including all features such as OCR and AI agent.
330
+ ----------
315
331
  Metodo responsavel por instalar todas libs para uso avançado do RPA-Suite com todas funcionalidades incluindo OCR e agente de IA
316
332
  """
317
333
 
318
334
  libs = [
335
+ "setuptools",
336
+ "wheel",
337
+ "pyperclip",
338
+ "pywin32",
319
339
  "colorama",
320
340
  "colorlog",
321
341
  "email_validator",
@@ -326,15 +346,16 @@ class Suite:
326
346
  "selenium",
327
347
  "typing",
328
348
  "webdriver_manager",
349
+ "docling",
329
350
  ]
330
351
 
331
352
  for lib in libs:
332
353
  try:
333
354
  subprocess.check_call([sys.executable, "-m", "pip", "install", lib])
334
- self.success_print(f"Biblioteca {lib} instalada com sucesso!")
355
+ self.success_print(f"Suite RPA: Library {lib} installed successfully!")
335
356
 
336
357
  except subprocess.CalledProcessError:
337
- self.error_print(f"Erro ao instalar biblioteca {lib}")
358
+ self.error_print(f"Suite RPA: Error installing library {lib}")
338
359
 
339
360
 
340
361
  rpa = Suite()
@@ -12,4 +12,4 @@ O módulo de utilitários da rpa-suite fornece uma coleção de funções e clas
12
12
  from .system import Tools
13
13
 
14
14
 
15
- __version__ = "1.5.5"
15
+ __version__ = "1.6.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rpa_suite
3
- Version: 1.5.9
3
+ Version: 1.6.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@vettracode.com
@@ -186,12 +186,12 @@ No setup do nosso projeto já estão inclusas as dependências, só será necess
186
186
  - pillow
187
187
  - pyautogui
188
188
  - typing
189
- - setuptools
190
189
 
191
- opcionalmente para automação de navegador:
190
+ opcionalmente para usar todas funcionalidades:
192
191
 
193
192
  - selenium
194
193
  - webdriver_manager
194
+ - docling
195
195
 
196
196
  <br>
197
197
  <hr>
@@ -282,19 +282,31 @@ O módulo principal do rpa-suite é dividido em categorias. Cada categoria cont
282
282
  - **get_result** - Função para obter o resultado da execução assíncrona, incluindo tempo de execução e status, com suporte a timeout.
283
283
  - **cancel** - Função para cancelar a tarefa assíncrona em execução.
284
284
 
285
+ **Iris (OCR-IA)**
286
+
287
+ - **read_document** - Reads and converts a document to the specified format.
288
+
289
+ <br>
290
+
285
291
  ## Release Notes
286
292
 
287
- ### Versão: **Beta 1.5.9**
293
+ ### Versão: **Beta 1.6.1**
288
294
 
289
295
  - **Data de Lançamento:** *20/02/2024*
290
- - **Última Atualização:** 06/06/2025
296
+ - **Última Atualização:** 08/06/2025
291
297
  - **Status:** Em desenvolvimento
292
298
 
293
299
  Esta versão marca um grande avanço no desenvolvimento da RPA Suite, trazendo melhorias significativas na arquitetura, novas funcionalidades e maior simplicidade no uso. Confira as principais mudanças abaixo.
294
300
 
295
- ### Notas da atualização:
301
+ ### Notas:
302
+ - atualização 1.6.0
303
+ - Adição Módulo: Iris (OCR-IA)
304
+ - Feat.: leitura de documento (aceita multiplos formatos)
305
+ - Feat.: leitura em lote (multiplos docmumentos em uma unica chamada)
306
+ - Melhoria de docstrings
296
307
 
297
- - Atualização de Linters e Formatters
308
+ - atualização 1.5.9
309
+ - Atualização de Linters e Formatters
298
310
  - black
299
311
  - pylint
300
312
  - bandit
@@ -1,6 +1,6 @@
1
- rpa_suite/__init__.py,sha256=uk4XRRpZn734AlzjPgvbmW0mO384jmOdYOZ8a0c--Q8,2365
2
- rpa_suite/suite.py,sha256=E4UDl4SgLSu2c2yI-qmK48NbQH2WwjSfvq3MAjmGnJ4,10568
3
- rpa_suite/core/__init__.py,sha256=2KWotqRNuCNwVhACACB4zhrXnTWR9H77_6U6j0WTJK0,1738
1
+ rpa_suite/__init__.py,sha256=olciiOHwT6n0OtAxGp2QH-GTLuS0IvfvnnJOObiKIMo,2915
2
+ rpa_suite/suite.py,sha256=ylGDXRhyIWM3wibmG_R0UbeHKz5-hYUaTT92LvA9IaU,11818
3
+ rpa_suite/core/__init__.py,sha256=dmW1RHmaX17QDJ-7lZgZys6JcY1o0kaoplAWSOnZpXY,1858
4
4
  rpa_suite/core/asyncrun.py,sha256=gRKsqvT4QAwg906BkLQXHi-oMbjM30D3yRWV1qAqj1Y,4192
5
5
  rpa_suite/core/browser.py,sha256=NeJk8lWDKZcGR9ULfWkDZ4WmFujU-DVr5-QH0qUSSgU,14725
6
6
  rpa_suite/core/clock.py,sha256=ELhgehLoqrf5bjkDpJ8wkcha9YmsnIfLb0qQW7OKrzw,13161
@@ -8,18 +8,19 @@ rpa_suite/core/date.py,sha256=nnAktYMZNjcN4e6HEiYJgdMLD5VZluaOjfyfSPaz71c,6307
8
8
  rpa_suite/core/dir.py,sha256=ZfgFeCkl8iB8Tc5dST35olImpj4PoWThovNYvtpwnu8,10329
9
9
  rpa_suite/core/email.py,sha256=D69vPmoBJYwSTgDu5tvXhakvsYprXr0BAFRYeaVicx0,8473
10
10
  rpa_suite/core/file.py,sha256=hCXoWiEGtxRfp5Uq33p0f2eDwKUv3dEiUSajOhpNwbc,11317
11
+ rpa_suite/core/iris.py,sha256=x-CvbIVtThFpA1AtmVlm-Ps97jcCuk-De-22WF3_qRo,5461
11
12
  rpa_suite/core/log.py,sha256=9dPDnV8e4p9lwZoyd1ICb6CjJiiSXTXVJseQkdtdRuQ,6542
12
13
  rpa_suite/core/parallel.py,sha256=a_aEqvoJ9jxsFg1H42wsPT2pCS3WApqbGc2PETgBBEs,11460
13
14
  rpa_suite/core/print.py,sha256=i1icdpNreQf2DCO6uLQKuuUD0vsrsOnYSpiQGaGNJi4,5780
14
15
  rpa_suite/core/regex.py,sha256=IHQF-xHVacDuloQqcBJdTCjd7oXVqDdbGa50Mb803Bk,3321
15
16
  rpa_suite/core/validate.py,sha256=Msk_bL9pBuenuUzFv7Wg9L_z3zXq0lOHsDavkwfaAn0,10620
16
17
  rpa_suite/functions/__create_ss_dir.py,sha256=kaRotLlYDCQGKtv9nd8zZUorQmHYGbHmOEWJ1DZBBYc,3426
17
- rpa_suite/functions/__init__.py,sha256=Y9Kp8tTmyCcQ4sErjb0c2cbDNTAAoTArEF2pYl7mt5s,57
18
+ rpa_suite/functions/__init__.py,sha256=7u63cRyow2OYQMt6Ph5uYImM_aUeMqdMaOvvO5v698Y,57
18
19
  rpa_suite/functions/_printer.py,sha256=gj7dwOt4roSj2iwOGWeGgUD3JVr7h4UESyCg9CmrieA,3946
19
- rpa_suite/utils/__init__.py,sha256=bqxq5kckulcQzNCn1tHwHj0WMIQBTUYNDzMzBhLtbIY,729
20
+ rpa_suite/utils/__init__.py,sha256=VAPzxR_aW-8kWsAUYzvrFdkH_aRLXywTUvj_qah9GwM,729
20
21
  rpa_suite/utils/system.py,sha256=kkTsjwBQ-8_G_6l-0tuwkpmeI3KVssRZ7QAiYlR3vt0,5185
21
- rpa_suite-1.5.9.dist-info/licenses/LICENSE,sha256=5D8PIbs31iGd9i1_MDNg4SzaQnp9sEIULALh2y3WyMI,1102
22
- rpa_suite-1.5.9.dist-info/METADATA,sha256=Cb7VubI35_hoUBEU8Tkz1RQke7yFpqkAyUUBfo9ydbs,12978
23
- rpa_suite-1.5.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- rpa_suite-1.5.9.dist-info/top_level.txt,sha256=HYkDtg-kJNAr3F2XAIPyJ-QBbNhk7q6jrqsFt10lz4Y,10
25
- rpa_suite-1.5.9.dist-info/RECORD,,
22
+ rpa_suite-1.6.1.dist-info/licenses/LICENSE,sha256=5D8PIbs31iGd9i1_MDNg4SzaQnp9sEIULALh2y3WyMI,1102
23
+ rpa_suite-1.6.1.dist-info/METADATA,sha256=wLNug0aSQf_uGvoVplzWELy6a9LL7Vc_BOh98MIwRt0,13324
24
+ rpa_suite-1.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ rpa_suite-1.6.1.dist-info/top_level.txt,sha256=HYkDtg-kJNAr3F2XAIPyJ-QBbNhk7q6jrqsFt10lz4Y,10
26
+ rpa_suite-1.6.1.dist-info/RECORD,,