Movva library to create automations.
Project description
movva-tech-library
Uma biblioteca de automação desktop focada em Windows, encapsulando e simplificando as funcionalidades do pywinauto e pyautogui.
Como inicializar
Para utilizar a biblioteca, basta importar e instanciar a classe DesktopRobot:
from movva_tech_library import DesktopRobot
from pathlib import Path
# Instanciando o robô
robot = DesktopRobot()
## Referência de Métodos
### Gerenciamento de Aplicações e Janelas
- **Iniciar uma aplicação:**
```python
robot.start_application(path=r"C:\Caminho\Para\App.exe", backend="uia")
-
Conectar a uma aplicação em execução:
robot.connect_application(title="Meu App", backend="uia")
-
Esperar por uma janela específica:
robot.wait_for_window(title="Janela Principal", timeout=10)
-
Definir janela ativa: (Útil para buscar locators apenas dentro dessa janela)
robot.set_active_window(title="Janela Principal")
-
Encerrar aplicação:
robot.kill()
Interação com Elementos da Interface (Locators pywinauto)
Os métodos abaixo aceitam qualquer critério do pywinauto (ex: title, auto_id, control_type).
-
Clicar por locator:
robot.click_by_locator(title="Botão Confirmar")
-
Duplo clique por locator:
robot.double_click_by_locator(auto_id="btnDetalhes")
-
Obter texto de um elemento:
texto = robot.get_text(auto_id="labelStatus") print(texto)
Interação por Imagens na Tela (pyautogui)
Recomenda-se o uso de caminhos absolutos para as imagens.
-
Clicar em uma imagem:
# Opcional: usar offset_x e offset_y para clicar deslocado do centro da imagem image_path = str(BASE_DIR / "assets" / "botao.png") robot.click_by_image(image_path, confidence=0.9, timeout=10)
-
Esperar por uma imagem aparecer na tela:
coordenadas = robot.wait_for_image(image_path, confidence=0.9, timeout=10)
Teclado e Digitação
-
Digitar texto: Pode focar em um elemento específico antes de digitar caso forneça um
locator.# Digita livremente onde o cursor estiver robot.type_text("Olá Mundo", interval=0.05) # Foca no input primeiro e depois digita robot.type_text("Meu texto direto no campo", locator={"auto_id": "inputTexto"})
-
Pressionar teclas isoladas:
robot.press_key("enter") robot.press_key("tab", presses=2)
-
Pressionar atalhos (hotkeys):
robot.hotkey("ctrl", "c") robot.hotkey("alt", "f4")
Esperas (Timeouts e Pausas)
- Pausa estática (não recomendado, use waits dinâmicos quando possível):
robot.wait(2.5) # Aguarda 2.5 segundos
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file movva_tech_library-0.1.5.tar.gz.
File metadata
- Download URL: movva_tech_library-0.1.5.tar.gz
- Upload date:
- Size: 51.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2072ace683bbb5dd377f202c3524f0d6f7404b6c3c479df4ac8e9fcc3b5ae43
|
|
| MD5 |
39fecaef644a68057b33e53784404397
|
|
| BLAKE2b-256 |
18486341e9815da8aa6ed6be986a15a58d8eec1d53d5c1a33e492b28acd1c7be
|
Provenance
The following attestation bundles were made for movva_tech_library-0.1.5.tar.gz:
Publisher:
release.yml on movva-tech/movva-tech-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
movva_tech_library-0.1.5.tar.gz -
Subject digest:
c2072ace683bbb5dd377f202c3524f0d6f7404b6c3c479df4ac8e9fcc3b5ae43 - Sigstore transparency entry: 1865481848
- Sigstore integration time:
-
Permalink:
movva-tech/movva-tech-library@b6fabed05e2c7158946655ce1034d51ccd957808 -
Branch / Tag:
refs/tags/0.0.10 - Owner: https://github.com/movva-tech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6fabed05e2c7158946655ce1034d51ccd957808 -
Trigger Event:
release
-
Statement type:
File details
Details for the file movva_tech_library-0.1.5-py3-none-any.whl.
File metadata
- Download URL: movva_tech_library-0.1.5-py3-none-any.whl
- Upload date:
- Size: 121.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f800a143307098384d8f5cc34a2101f7b6499aff550de90e985f76897e64d4f
|
|
| MD5 |
7cbb75c319a645dec1a4da4c5464ae88
|
|
| BLAKE2b-256 |
cec93adb1a480332df6eb1266448ead1eed20429a4721a78dbeac702562ae1ac
|
Provenance
The following attestation bundles were made for movva_tech_library-0.1.5-py3-none-any.whl:
Publisher:
release.yml on movva-tech/movva-tech-library
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
movva_tech_library-0.1.5-py3-none-any.whl -
Subject digest:
7f800a143307098384d8f5cc34a2101f7b6499aff550de90e985f76897e64d4f - Sigstore transparency entry: 1865481949
- Sigstore integration time:
-
Permalink:
movva-tech/movva-tech-library@b6fabed05e2c7158946655ce1034d51ccd957808 -
Branch / Tag:
refs/tags/0.0.10 - Owner: https://github.com/movva-tech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6fabed05e2c7158946655ce1034d51ccd957808 -
Trigger Event:
release
-
Statement type: