Metadata-Version: 2.4
Name: josias
Version: 0.1.0
Summary: Biblioteca Python de automação web com Selenium e visão computacional.
Project-URL: Homepage, https://github.com/JosiasAz/josias
Project-URL: Documentation, https://github.com/JosiasAz/josias#readme
Project-URL: Repository, https://github.com/JosiasAz/josias
Project-URL: Issues, https://github.com/JosiasAz/josias/issues
Project-URL: Changelog, https://github.com/JosiasAz/josias/blob/main/CHANGELOG.md
Author: Josias Automation
License-Expression: MIT
License-File: LICENSE
Keywords: automation,computer-vision,josias,ocr,rpa,selenium,web
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Requires-Dist: numpy>=1.24.0
Requires-Dist: opencv-python-headless>=4.8.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: selenium>=4.15.0
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: twine>=4.0.0; extra == 'dev'
Provides-Extra: vision
Requires-Dist: pytesseract>=0.3.10; extra == 'vision'
Description-Content-Type: text/markdown

# Josias

Biblioteca Python para automação web com **Selenium** e **visão computacional** — simples, limpa e pronta para escalar.

Parte do ecossistema **Josias**, uma plataforma completa de automação RPA.

## Instalação

```bash
pip install josias

# Com OCR (requer Tesseract instalado no sistema)
pip install josias[vision]

# Desenvolvimento local
pip install -e ".[dev,vision]"
```

### Pré-requisitos

- Python 3.10+
- Google Chrome, Firefox ou Edge
- [Tesseract OCR](https://github.com/UB-Mannheim/tesseract/wiki) — necessário apenas para recursos de OCR

## Uso rápido

```python
from josias import Josias

with Josias() as bot:
    bot.open("https://example.com")

    # DOM — seletores CSS simples
    bot.click("#login")
    bot.type("#email", "usuario@email.com")
    bot.type("#password", "senha123", submit=True)

    # Esperas
    bot.wait_for("#dashboard")

    # Visão computacional (OCR + imagem)
    bot.click_text("Confirmar")
    bot.click_image("assets/botao_ok.png")
```

## Seletores

| Formato | Exemplo | Descrição |
|---------|---------|-----------|
| CSS (padrão) | `"#login"`, `".btn"` | Seletor CSS |
| XPath | `"xpath://button"` | XPath explícito |
| ID | `"id:username"` | Por atributo id |
| Texto | `"text:Entrar"` | Por texto visível na página |

## Configuração

```python
from josias import Josias, Config, VisionConfig
from josias.types import Browser

config = Config(
    browser=Browser.CHROME,
    headless=True,
    window_size=(1920, 1080),
    default_timeout=15.0,
    vision=VisionConfig(
        confidence_threshold=80.0,
        tesseract_lang="por",
    ),
)

with Josias(config) as bot:
    bot.open("https://example.com")
```

## Tarefas com backtrack

Execute sequências de ações com retry automático entre etapas:

```python
with Josias() as bot:
    bot.open("https://app.exemplo.com")

    bot.run([
        {"text": "Login", "sendtext": "usuario", "backtrack": True},
        {"text": "Senha", "sendtext": "123456", "backtrack": True},
        {"image": "submit.png", "backtrack": True, "confidence": 0.9},
    ])
```

## Arquitetura

```
src/josias/
├── bot.py           # Classe principal
├── config.py        # Configuração centralizada
├── browser/         # Gerenciamento Selenium
├── dom/             # Seletores e interação DOM
├── vision/          # OCR e detecção de imagem
├── actions/         # Mouse, teclado e tarefas
└── waits.py         # Esperas explícitas
```

## Publicação no PyPI

```bash
python -m build
python -m twine check dist/*
python -m twine upload dist/*
```

Ou crie uma **Release** no GitHub — o workflow publica automaticamente via Trusted Publishing.

## Roadmap

- [x] Core Selenium com API simplificada
- [x] Visão computacional (OCR + imagem)
- [x] Executor de tarefas com backtrack
- [ ] Orquestrador Josias
- [ ] Plugins (Excel, AWS, e-mail)
- [ ] CLI e deploy de bots

## Licença

MIT — veja [LICENSE](LICENSE).
