pyrpa-framework 0.1.0__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.
Files changed (42) hide show
  1. pyrpa_framework-0.1.0/LICENSE +21 -0
  2. pyrpa_framework-0.1.0/PKG-INFO +223 -0
  3. pyrpa_framework-0.1.0/README.md +160 -0
  4. pyrpa_framework-0.1.0/pyproject.toml +62 -0
  5. pyrpa_framework-0.1.0/pyrpa/__init__.py +0 -0
  6. pyrpa_framework-0.1.0/pyrpa/__main__.py +5 -0
  7. pyrpa_framework-0.1.0/pyrpa/cli.py +593 -0
  8. pyrpa_framework-0.1.0/pyrpa/core/__init__.py +18 -0
  9. pyrpa_framework-0.1.0/pyrpa/core/compiler.py +166 -0
  10. pyrpa_framework-0.1.0/pyrpa/core/doctor.py +221 -0
  11. pyrpa_framework-0.1.0/pyrpa/core/generator.py +337 -0
  12. pyrpa_framework-0.1.0/pyrpa/core/installer.py +168 -0
  13. pyrpa_framework-0.1.0/pyrpa/core/modifier.py +346 -0
  14. pyrpa_framework-0.1.0/pyrpa/core/runner.py +193 -0
  15. pyrpa_framework-0.1.0/pyrpa/core/validator.py +42 -0
  16. pyrpa_framework-0.1.0/pyrpa/domain/__init__.py +17 -0
  17. pyrpa_framework-0.1.0/pyrpa/domain/contracts.py +91 -0
  18. pyrpa_framework-0.1.0/pyrpa/domain/queue.py +118 -0
  19. pyrpa_framework-0.1.0/pyrpa/infrastructure/__init__.py +32 -0
  20. pyrpa_framework-0.1.0/pyrpa/infrastructure/ai.py +131 -0
  21. pyrpa_framework-0.1.0/pyrpa/infrastructure/browser.py +187 -0
  22. pyrpa_framework-0.1.0/pyrpa/infrastructure/database.py +111 -0
  23. pyrpa_framework-0.1.0/pyrpa/infrastructure/http_client.py +101 -0
  24. pyrpa_framework-0.1.0/pyrpa/infrastructure/logger.py +89 -0
  25. pyrpa_framework-0.1.0/pyrpa/infrastructure/notifier.py +136 -0
  26. pyrpa_framework-0.1.0/pyrpa/infrastructure/pdf.py +71 -0
  27. pyrpa_framework-0.1.0/pyrpa/infrastructure/storage.py +134 -0
  28. pyrpa_framework-0.1.0/pyrpa/models/__init__.py +0 -0
  29. pyrpa_framework-0.1.0/pyrpa/models/schema.py +66 -0
  30. pyrpa_framework-0.1.0/pyrpa/templates/project_structure/application/__init__.py +0 -0
  31. pyrpa_framework-0.1.0/pyrpa/templates/project_structure/domain/__init__.py +0 -0
  32. pyrpa_framework-0.1.0/pyrpa/templates/project_structure/infrastructure/__init__.py +0 -0
  33. pyrpa_framework-0.1.0/pyrpa/templates/project_structure/interfaces/__init__.py +0 -0
  34. pyrpa_framework-0.1.0/pyrpa/templates/project_structure/main.py +0 -0
  35. pyrpa_framework-0.1.0/pyrpa_framework.egg-info/PKG-INFO +223 -0
  36. pyrpa_framework-0.1.0/pyrpa_framework.egg-info/SOURCES.txt +40 -0
  37. pyrpa_framework-0.1.0/pyrpa_framework.egg-info/dependency_links.txt +1 -0
  38. pyrpa_framework-0.1.0/pyrpa_framework.egg-info/entry_points.txt +2 -0
  39. pyrpa_framework-0.1.0/pyrpa_framework.egg-info/requires.txt +19 -0
  40. pyrpa_framework-0.1.0/pyrpa_framework.egg-info/top_level.txt +1 -0
  41. pyrpa_framework-0.1.0/setup.cfg +4 -0
  42. pyrpa_framework-0.1.0/setup.py +3 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kauê Cunha Baesso e Nícolas Paulo Nasário
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,223 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyrpa-framework
3
+ Version: 0.1.0
4
+ Summary: CLI opinativa para scaffolding e orquestração declarativa de projetos RPA em Clean Architecture
5
+ Author: Kauê Cunha Baesso
6
+ Author-email: Nícolas Paulo Nasário <nicolaspn09@gmail.com>
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 Kauê Cunha Baesso e Nícolas Paulo Nasário
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: Homepage, https://github.com/nicolaspn09/pyrpa
30
+ Project-URL: Documentation, https://github.com/nicolaspn09/pyrpa/blob/main/docs/MANUAL_DESENVOLVEDOR_PYRPA.md
31
+ Project-URL: Repository, https://github.com/nicolaspn09/pyrpa.git
32
+ Keywords: rpa,clean-architecture,automation,airflow,cli,yaml,pydantic
33
+ Classifier: Development Status :: 4 - Beta
34
+ Classifier: Intended Audience :: Developers
35
+ Classifier: License :: OSI Approved :: MIT License
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.10
39
+ Classifier: Programming Language :: Python :: 3.11
40
+ Classifier: Programming Language :: Python :: 3.12
41
+ Classifier: Topic :: Software Development :: Code Generators
42
+ Requires-Python: >=3.10
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Requires-Dist: typer>=0.12.0
46
+ Requires-Dist: rich>=13.0.0
47
+ Requires-Dist: pydantic>=2.0.0
48
+ Requires-Dist: pyyaml>=6.0.0
49
+ Requires-Dist: jinja2>=3.1.0
50
+ Requires-Dist: python-dotenv>=1.0.0
51
+ Requires-Dist: pandas>=2.0.0
52
+ Requires-Dist: openpyxl>=3.1.0
53
+ Requires-Dist: pypdf>=5.0.0
54
+ Requires-Dist: sqlalchemy>=2.0.0
55
+ Requires-Dist: selenium>=4.15.0
56
+ Requires-Dist: playwright>=1.40.0
57
+ Requires-Dist: openai>=1.0.0
58
+ Provides-Extra: dev
59
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
60
+ Provides-Extra: undetected
61
+ Requires-Dist: undetected-chromedriver>=3.5.0; extra == "undetected"
62
+ Dynamic: license-file
63
+
64
+ # 🤖 pyrpa
65
+
66
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
67
+ [![Architecture](https://img.shields.io/badge/architecture-Clean%20Architecture-brightgreen.svg)](#-arquitetura-gerada-nos-projetos-filhos)
68
+ [![Validation](https://img.shields.io/badge/validation-Pydantic%20v2-purple.svg)](https://docs.pydantic.dev/latest/)
69
+ [![CLI Framework](https://img.shields.io/badge/CLI-Typer%20%2B%20Rich-orange.svg)](https://typer.tiangolo.com/)
70
+ [![Tests](https://img.shields.io/badge/tests-69%2F69%20passing-success.svg)](#-testes-e-qualidade)
71
+ [![License](https://img.shields.io/badge/license-MIT-informational.svg)](LICENSE)
72
+
73
+ > **CLI Opinativa para Gestão de Projetos de Robotic Process Automation (RPA) em Python Corporativo com Clean Architecture e Orquestração Declarativa.**
74
+
75
+ ---
76
+
77
+ ## 📌 Visão Geral
78
+
79
+ Estudos de mercado (Ernst & Young, Deloitte) apontam que entre **30% e 50% dos projetos corporativos de automação falham ao tentar escalar**. A raiz desse gargalo é o **alto débito técnico**: scripts construídos sem padrões estruturais (*code smells* em até 98% dos repositórios não padronizados), onde lógicas de negócio estão misturadas com código de infraestrutura (drivers de navegadores, bibliotecas de scraping e conexões de banco de dados).
80
+
81
+ O **`pyrpa`** resolve esse problema através da **padronização arquitetural obrigatória**:
82
+ - **Força a Clean Architecture**: Desacopla estritamente regras de domínio (`domain/` e `application/`) das bibliotecas voláteis de infraestrutura (`infrastructure/`).
83
+ - **Orquestração Declarativa**: Cada robô possui um contrato `metadados/fluxo.yaml` validado por schemas Pydantic v2.
84
+ - **Execução Local + Apache Airflow**: Roda localmente com `pyrpa run` (carregando o `.env` automaticamente) ou compila nativamente em DAGs do Airflow com `pyrpa compile`.
85
+ - **Dependências Prontas e Verificação Automática**: Instala automaticamente todas as bibliotecas dos conectores escolhidos (`pandas`, `openpyxl`, `pypdf`, `sqlalchemy`, `playwright`, `selenium`, `openai`, `python-dotenv`).
86
+ - **Auditoria & Observabilidade**: Impede duplicidade de IDs e garante rastreabilidade com logs estruturados.
87
+
88
+ > 📖 **Documentação Técnica Completa:** consulte [docs/MANUAL_DESENVOLVEDOR_PYRPA.md](docs/MANUAL_DESENVOLVEDOR_PYRPA.md).
89
+
90
+ ---
91
+
92
+ ## 🚀 Instalação (Linux, macOS e Windows)
93
+
94
+ ### Pré-requisitos
95
+ - **Python 3.10 ou superior** (compatível nativamente com Ubuntu 22.04+, Debian 12+, macOS e Windows 10/11).
96
+ - `git` (opcional, se clonar o repositório).
97
+
98
+ > **Importante:** O nome do pacote oficial no PyPI é **`pyrpa-framework`** (nunca rode `pip install pyrpa`, pois `pyrpa` no PyPI é outra biblioteca de terceiros). Se já instalou errado antes, remova com `pip uninstall pyrpa -y`.
99
+
100
+ ### Opção 1: Via PyPI Oficial em Ambiente Virtual (`.venv`) — Mais Rápida (Sem Git)
101
+
102
+ **No Linux / Ubuntu / macOS:**
103
+ ```bash
104
+ python3 -m venv .venv
105
+ source .venv/bin/activate
106
+ pip install pyrpa-framework
107
+ pyrpa doctor
108
+ ```
109
+ *(Se no Ubuntu aparecer aviso de módulo `venv` faltando, rode antes: `sudo apt update && sudo apt install -y python3 python3-pip python3-venv`).*
110
+
111
+ **No Windows (PowerShell):**
112
+ ```powershell
113
+ python -m venv .venv
114
+ .\.venv\Scripts\Activate.ps1
115
+ pip install pyrpa-framework
116
+ pyrpa doctor
117
+ ```
118
+
119
+ ---
120
+
121
+ ### Opção 2: Instalador Automático do Repositório (1 Comando)
122
+
123
+ #### 🐧 Linux / Ubuntu / macOS
124
+ Cria um ambiente isolado automaticamente (evitando erros de permissão do Ubuntu) e configura o comando `pyrpa`:
125
+ ```bash
126
+ git clone https://github.com/nicolaspn09/pyrpa.git
127
+ cd pyrpa
128
+ bash instalar.sh
129
+ ```
130
+
131
+ #### 🪟 Windows (PowerShell ou Prompt de Comando)
132
+ ```powershell
133
+ git clone https://github.com/nicolaspn09/pyrpa.git
134
+ cd pyrpa
135
+ .\instalar.bat
136
+ ```
137
+ *(Ou dê 2 cliques no arquivo `instalar.bat` dentro da pasta baixada).*
138
+
139
+ > **Dica se o comando `pyrpa` não for reconhecido no terminal:** utilize sempre `python -m pyrpa doctor` (ou `python3 -m pyrpa doctor` no Linux). O módulo `pyrpa` responde exatamente aos mesmos comandos e opções.
140
+
141
+ ---
142
+
143
+ ## 💻 Guia Completo de Comandos da CLI
144
+
145
+ ```powershell
146
+ # Ver ajuda completa, versão, catálogo interativo e saúde do sistema
147
+ pyrpa --help
148
+ pyrpa --version
149
+ pyrpa info
150
+ pyrpa doctor
151
+
152
+ # 1. Criar um novo projeto RPA (verifica e instala libs faltantes automaticamente)
153
+ pyrpa init robo_completo -m completo # Todos os conectores
154
+ pyrpa init robo_compras -m web,banco # Apenas módulos selecionados
155
+ pyrpa init meu_robo # Menu interativo no terminal
156
+ pyrpa init robo_pasta -d C:\Projetos\robo --forcar
157
+
158
+ # 2. Adicionar um conector extra depois de criado (web, banco, excel, pdf, ia, email)
159
+ cd robo_compras
160
+ pyrpa add pdf
161
+ pyrpa add excel
162
+
163
+ # 3. Validar o contrato declarativo YAML (Pydantic v2)
164
+ pyrpa validate
165
+
166
+ # 4. Executar o robô localmente (lê o .env da pasta do robô automaticamente)
167
+ pyrpa run
168
+ # Ou diretamente via Python:
169
+ python main.py
170
+
171
+ # 5. Compilar o fluxo.yaml para uma DAG do Apache Airflow
172
+ pyrpa compile -s diario # manual | horario | diario | semanal | mensal | "cron"
173
+ ```
174
+
175
+ ---
176
+
177
+ ## 🏛 Arquitetura Gerada nos Projetos-Filhos
178
+
179
+ Ao rodar `pyrpa init <nome_do_projeto>`, a árvore gerada segue o isolamento da Arquitetura Limpa:
180
+
181
+ ```text
182
+ <nome_do_projeto>/
183
+ ├── domain/ # Regras de cálculo, entidades e filas (zero dependências externas)
184
+ ├── application/ # Casos de uso (UseCases) herdando de BaseUseCase
185
+ ├── infrastructure/ # Adaptadores defensivos (browser, database, storage, pdf, ai, notifier, http_client, logger)
186
+ ├── interfaces/ # Controladores locais e pontos de entrada
187
+ ├── metadados/
188
+ │ └── fluxo.yaml # Grafo declarativo de execução validado pelo Pydantic
189
+ ├── dags/ # DAGs Python compiladas para o Apache Airflow
190
+ ├── relatorios/ # Planilhas Excel exportadas
191
+ ├── logs/ # Logs estruturados de auditoria
192
+ ├── requirements.txt # Dependências ativas descomentadas (sem colisão com PyPI)
193
+ ├── .env # Variáveis de ambiente locais (lidas automaticamente pelo FluxoRunner)
194
+ ├── .gitignore # Proteção contra vazamento de credenciais e caches
195
+ └── main.py # Ponto de entrada de execução direta
196
+ ```
197
+
198
+ ---
199
+
200
+ ## 🧪 Testes e Qualidade
201
+
202
+ O framework possui **69 testes unitários e de integração** automatizados com `pytest`:
203
+
204
+ ```bash
205
+ # Executar toda a suíte
206
+ pytest -v
207
+ ```
208
+
209
+ * `tests/integration/test_cli.py` — Testes ponta a ponta da CLI (`--version`, `info`, `doctor`, `init`, `add`, `validate`, `run`, `compile` e dica de navegação).
210
+ * `tests/unit/test_schema.py` & `test_validator.py` — Contratos Pydantic v2, regex e leitura segura de YAML.
211
+ * `tests/unit/test_generator.py`, `test_modifier.py` & `test_installer.py` — Scaffolding Clean Architecture, inclusão modular e instalação automática de dependências.
212
+ * `tests/unit/test_runner.py`, `test_compiler.py` & `test_contracts.py` — Execução com `.env`, compartilhamento de contexto e compilação Airflow.
213
+ * `tests/unit/test_infrastructure.py`, `test_doctor.py`, `test_ai.py`, `test_pdf.py` & `test_queue.py` — Adaptadores de infraestrutura, diagnóstico SO/navegadores e fila transacional.
214
+
215
+ ---
216
+
217
+ ## 🎓 Contexto Acadêmico e Autoria
218
+
219
+ Projeto desenvolvido como **Trabalho de Conclusão de Curso (TCC II)** do curso de **Tecnologia em Análise e Desenvolvimento de Sistemas (ADS)** do **Instituto Federal de Santa Catarina (IFSC — Câmpus Tubarão)**.
220
+
221
+ - **Autores:** Kauê Cunha Baesso e [Nícolas Paulo Nasário](https://github.com/nicolaspn09)
222
+ - **Orientador:** Prof. Tiago Guimarães Moraes
223
+ - **Licença:** MIT
@@ -0,0 +1,160 @@
1
+ # 🤖 pyrpa
2
+
3
+ [![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
4
+ [![Architecture](https://img.shields.io/badge/architecture-Clean%20Architecture-brightgreen.svg)](#-arquitetura-gerada-nos-projetos-filhos)
5
+ [![Validation](https://img.shields.io/badge/validation-Pydantic%20v2-purple.svg)](https://docs.pydantic.dev/latest/)
6
+ [![CLI Framework](https://img.shields.io/badge/CLI-Typer%20%2B%20Rich-orange.svg)](https://typer.tiangolo.com/)
7
+ [![Tests](https://img.shields.io/badge/tests-69%2F69%20passing-success.svg)](#-testes-e-qualidade)
8
+ [![License](https://img.shields.io/badge/license-MIT-informational.svg)](LICENSE)
9
+
10
+ > **CLI Opinativa para Gestão de Projetos de Robotic Process Automation (RPA) em Python Corporativo com Clean Architecture e Orquestração Declarativa.**
11
+
12
+ ---
13
+
14
+ ## 📌 Visão Geral
15
+
16
+ Estudos de mercado (Ernst & Young, Deloitte) apontam que entre **30% e 50% dos projetos corporativos de automação falham ao tentar escalar**. A raiz desse gargalo é o **alto débito técnico**: scripts construídos sem padrões estruturais (*code smells* em até 98% dos repositórios não padronizados), onde lógicas de negócio estão misturadas com código de infraestrutura (drivers de navegadores, bibliotecas de scraping e conexões de banco de dados).
17
+
18
+ O **`pyrpa`** resolve esse problema através da **padronização arquitetural obrigatória**:
19
+ - **Força a Clean Architecture**: Desacopla estritamente regras de domínio (`domain/` e `application/`) das bibliotecas voláteis de infraestrutura (`infrastructure/`).
20
+ - **Orquestração Declarativa**: Cada robô possui um contrato `metadados/fluxo.yaml` validado por schemas Pydantic v2.
21
+ - **Execução Local + Apache Airflow**: Roda localmente com `pyrpa run` (carregando o `.env` automaticamente) ou compila nativamente em DAGs do Airflow com `pyrpa compile`.
22
+ - **Dependências Prontas e Verificação Automática**: Instala automaticamente todas as bibliotecas dos conectores escolhidos (`pandas`, `openpyxl`, `pypdf`, `sqlalchemy`, `playwright`, `selenium`, `openai`, `python-dotenv`).
23
+ - **Auditoria & Observabilidade**: Impede duplicidade de IDs e garante rastreabilidade com logs estruturados.
24
+
25
+ > 📖 **Documentação Técnica Completa:** consulte [docs/MANUAL_DESENVOLVEDOR_PYRPA.md](docs/MANUAL_DESENVOLVEDOR_PYRPA.md).
26
+
27
+ ---
28
+
29
+ ## 🚀 Instalação (Linux, macOS e Windows)
30
+
31
+ ### Pré-requisitos
32
+ - **Python 3.10 ou superior** (compatível nativamente com Ubuntu 22.04+, Debian 12+, macOS e Windows 10/11).
33
+ - `git` (opcional, se clonar o repositório).
34
+
35
+ > **Importante:** O nome do pacote oficial no PyPI é **`pyrpa-framework`** (nunca rode `pip install pyrpa`, pois `pyrpa` no PyPI é outra biblioteca de terceiros). Se já instalou errado antes, remova com `pip uninstall pyrpa -y`.
36
+
37
+ ### Opção 1: Via PyPI Oficial em Ambiente Virtual (`.venv`) — Mais Rápida (Sem Git)
38
+
39
+ **No Linux / Ubuntu / macOS:**
40
+ ```bash
41
+ python3 -m venv .venv
42
+ source .venv/bin/activate
43
+ pip install pyrpa-framework
44
+ pyrpa doctor
45
+ ```
46
+ *(Se no Ubuntu aparecer aviso de módulo `venv` faltando, rode antes: `sudo apt update && sudo apt install -y python3 python3-pip python3-venv`).*
47
+
48
+ **No Windows (PowerShell):**
49
+ ```powershell
50
+ python -m venv .venv
51
+ .\.venv\Scripts\Activate.ps1
52
+ pip install pyrpa-framework
53
+ pyrpa doctor
54
+ ```
55
+
56
+ ---
57
+
58
+ ### Opção 2: Instalador Automático do Repositório (1 Comando)
59
+
60
+ #### 🐧 Linux / Ubuntu / macOS
61
+ Cria um ambiente isolado automaticamente (evitando erros de permissão do Ubuntu) e configura o comando `pyrpa`:
62
+ ```bash
63
+ git clone https://github.com/nicolaspn09/pyrpa.git
64
+ cd pyrpa
65
+ bash instalar.sh
66
+ ```
67
+
68
+ #### 🪟 Windows (PowerShell ou Prompt de Comando)
69
+ ```powershell
70
+ git clone https://github.com/nicolaspn09/pyrpa.git
71
+ cd pyrpa
72
+ .\instalar.bat
73
+ ```
74
+ *(Ou dê 2 cliques no arquivo `instalar.bat` dentro da pasta baixada).*
75
+
76
+ > **Dica se o comando `pyrpa` não for reconhecido no terminal:** utilize sempre `python -m pyrpa doctor` (ou `python3 -m pyrpa doctor` no Linux). O módulo `pyrpa` responde exatamente aos mesmos comandos e opções.
77
+
78
+ ---
79
+
80
+ ## 💻 Guia Completo de Comandos da CLI
81
+
82
+ ```powershell
83
+ # Ver ajuda completa, versão, catálogo interativo e saúde do sistema
84
+ pyrpa --help
85
+ pyrpa --version
86
+ pyrpa info
87
+ pyrpa doctor
88
+
89
+ # 1. Criar um novo projeto RPA (verifica e instala libs faltantes automaticamente)
90
+ pyrpa init robo_completo -m completo # Todos os conectores
91
+ pyrpa init robo_compras -m web,banco # Apenas módulos selecionados
92
+ pyrpa init meu_robo # Menu interativo no terminal
93
+ pyrpa init robo_pasta -d C:\Projetos\robo --forcar
94
+
95
+ # 2. Adicionar um conector extra depois de criado (web, banco, excel, pdf, ia, email)
96
+ cd robo_compras
97
+ pyrpa add pdf
98
+ pyrpa add excel
99
+
100
+ # 3. Validar o contrato declarativo YAML (Pydantic v2)
101
+ pyrpa validate
102
+
103
+ # 4. Executar o robô localmente (lê o .env da pasta do robô automaticamente)
104
+ pyrpa run
105
+ # Ou diretamente via Python:
106
+ python main.py
107
+
108
+ # 5. Compilar o fluxo.yaml para uma DAG do Apache Airflow
109
+ pyrpa compile -s diario # manual | horario | diario | semanal | mensal | "cron"
110
+ ```
111
+
112
+ ---
113
+
114
+ ## 🏛 Arquitetura Gerada nos Projetos-Filhos
115
+
116
+ Ao rodar `pyrpa init <nome_do_projeto>`, a árvore gerada segue o isolamento da Arquitetura Limpa:
117
+
118
+ ```text
119
+ <nome_do_projeto>/
120
+ ├── domain/ # Regras de cálculo, entidades e filas (zero dependências externas)
121
+ ├── application/ # Casos de uso (UseCases) herdando de BaseUseCase
122
+ ├── infrastructure/ # Adaptadores defensivos (browser, database, storage, pdf, ai, notifier, http_client, logger)
123
+ ├── interfaces/ # Controladores locais e pontos de entrada
124
+ ├── metadados/
125
+ │ └── fluxo.yaml # Grafo declarativo de execução validado pelo Pydantic
126
+ ├── dags/ # DAGs Python compiladas para o Apache Airflow
127
+ ├── relatorios/ # Planilhas Excel exportadas
128
+ ├── logs/ # Logs estruturados de auditoria
129
+ ├── requirements.txt # Dependências ativas descomentadas (sem colisão com PyPI)
130
+ ├── .env # Variáveis de ambiente locais (lidas automaticamente pelo FluxoRunner)
131
+ ├── .gitignore # Proteção contra vazamento de credenciais e caches
132
+ └── main.py # Ponto de entrada de execução direta
133
+ ```
134
+
135
+ ---
136
+
137
+ ## 🧪 Testes e Qualidade
138
+
139
+ O framework possui **69 testes unitários e de integração** automatizados com `pytest`:
140
+
141
+ ```bash
142
+ # Executar toda a suíte
143
+ pytest -v
144
+ ```
145
+
146
+ * `tests/integration/test_cli.py` — Testes ponta a ponta da CLI (`--version`, `info`, `doctor`, `init`, `add`, `validate`, `run`, `compile` e dica de navegação).
147
+ * `tests/unit/test_schema.py` & `test_validator.py` — Contratos Pydantic v2, regex e leitura segura de YAML.
148
+ * `tests/unit/test_generator.py`, `test_modifier.py` & `test_installer.py` — Scaffolding Clean Architecture, inclusão modular e instalação automática de dependências.
149
+ * `tests/unit/test_runner.py`, `test_compiler.py` & `test_contracts.py` — Execução com `.env`, compartilhamento de contexto e compilação Airflow.
150
+ * `tests/unit/test_infrastructure.py`, `test_doctor.py`, `test_ai.py`, `test_pdf.py` & `test_queue.py` — Adaptadores de infraestrutura, diagnóstico SO/navegadores e fila transacional.
151
+
152
+ ---
153
+
154
+ ## 🎓 Contexto Acadêmico e Autoria
155
+
156
+ Projeto desenvolvido como **Trabalho de Conclusão de Curso (TCC II)** do curso de **Tecnologia em Análise e Desenvolvimento de Sistemas (ADS)** do **Instituto Federal de Santa Catarina (IFSC — Câmpus Tubarão)**.
157
+
158
+ - **Autores:** Kauê Cunha Baesso e [Nícolas Paulo Nasário](https://github.com/nicolaspn09)
159
+ - **Orientador:** Prof. Tiago Guimarães Moraes
160
+ - **Licença:** MIT
@@ -0,0 +1,62 @@
1
+ [build-system]
2
+ requires = ["setuptools>=64.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pyrpa-framework"
7
+ version = "0.1.0"
8
+ description = "CLI opinativa para scaffolding e orquestração declarativa de projetos RPA em Clean Architecture"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ { name = "Kauê Cunha Baesso" },
14
+ { name = "Nícolas Paulo Nasário", email = "nicolaspn09@gmail.com" }
15
+ ]
16
+ keywords = ["rpa", "clean-architecture", "automation", "airflow", "cli", "yaml", "pydantic"]
17
+ classifiers = [
18
+ "Development Status :: 4 - Beta",
19
+ "Intended Audience :: Developers",
20
+ "License :: OSI Approved :: MIT License",
21
+ "Operating System :: OS Independent",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Topic :: Software Development :: Code Generators",
27
+ ]
28
+ dependencies = [
29
+ "typer>=0.12.0",
30
+ "rich>=13.0.0",
31
+ "pydantic>=2.0.0",
32
+ "pyyaml>=6.0.0",
33
+ "jinja2>=3.1.0",
34
+ "python-dotenv>=1.0.0",
35
+ "pandas>=2.0.0",
36
+ "openpyxl>=3.1.0",
37
+ "pypdf>=5.0.0",
38
+ "sqlalchemy>=2.0.0",
39
+ "selenium>=4.15.0",
40
+ "playwright>=1.40.0",
41
+ "openai>=1.0.0"
42
+ ]
43
+
44
+ [project.optional-dependencies]
45
+ dev = [
46
+ "pytest>=8.0.0"
47
+ ]
48
+ undetected = [
49
+ "undetected-chromedriver>=3.5.0"
50
+ ]
51
+
52
+ [project.urls]
53
+ Homepage = "https://github.com/nicolaspn09/pyrpa"
54
+ Documentation = "https://github.com/nicolaspn09/pyrpa/blob/main/docs/MANUAL_DESENVOLVEDOR_PYRPA.md"
55
+ Repository = "https://github.com/nicolaspn09/pyrpa.git"
56
+
57
+ [project.scripts]
58
+ pyrpa = "pyrpa.cli:app"
59
+
60
+ [tool.setuptools.packages.find]
61
+ where = ["."]
62
+ include = ["pyrpa*"]
File without changes
@@ -0,0 +1,5 @@
1
+ from pyrpa.cli import app
2
+
3
+
4
+ if __name__ == "__main__":
5
+ app()