Skip to main content

Automacao silenciosa para Power BI Desktop

Project description

Phaze v1.1.4

[PT] Biblioteca para automação silenciosa, robusta e "headless" do Microsoft Power BI Desktop. [EN] Library for silent, robust, and "headless" automation of Microsoft Power BI Desktop.


Principais Recursos / Key Features

Português

  • Limbo Mode: Move a janela do Power BI para coordenadas negativas (-30000), permitindo que você continue usando o computador enquanto o robô trabalha.
  • Kernel Force Save: Ignora falhas de clique visual. Utiliza injeção direta de mensagens no Kernel do Windows (PostMessage com Scan Codes reais) para forçar o salvamento (Ctrl+S) mesmo com a janela oculta.
  • Crash Recovery: Detecta e trata automaticamente o erro "Há um problema com o WebView2" que ocorre ao renderizar gráficos fora da tela.
  • Smart Refresh: Monitora a estabilidade visual do popup de atualização e detecta janelas que fecham sozinhas (Auto-Close).

English

  • Limbo Mode: Moves the Power BI window to negative coordinates (-30000), allowing you to use the computer while the bot works.
  • Kernel Force Save: Bypasses visual click failures. Uses direct Kernel message injection (PostMessage with real Scan Codes) to force save (Ctrl+S) even when the window is hidden.
  • Crash Recovery: Automatically detects and handles the "There is a problem with WebView2" error that occurs when rendering charts off-screen.
  • Smart Refresh: Monitors the visual stability of the refresh popup and detects windows that close automatically (Auto-Close).

Instalação / Installation

pip install phaze.

Como Usar / How to Use

A Phaze v1.1.4 funciona como um "Toolkit Modular". Você decide a ordem das ações.Phaze v1.1.4 operates as a "Modular Toolkit". You decide the order of actions.

Exemplo Completo (The Maestro Script)

import time
from phaze.local_ops import Phaze

# Configuração
NOME_JANELA = "Nome do Seu Arquivo PBI"

def main():
    # 1. Inicializa
    driver = Phaze()

    # 2. Conecta
    print("Conectando...")
    if not driver.connect(window_name=NOME_JANELA):
        print("Janela não encontrada.")
        return

    # 3. Atualiza (Refresh)
    print("Atualizando dados...")
    # Agora chamamos o método a partir de 'driver'
    if driver.refresh():
        print("Atualização concluída com sucesso.")
    else:
        print("Falha na atualização.")
        driver.bring_back()
        return

    # 4. Salva (Save)
    print("Salvando...")
    if driver.save():
        print("Comando de salvar enviado.")
    else:
        print("Erro ao salvar.")

    # 5. Finaliza
    driver.bring_back() 
    print("Processo finalizado.")

if __name__ == "__main__":
    main()

Índice de Drivers (API Reference)

A classe Phaze expõe os seguintes métodos para controle total:

Método / Method Descrição (PT) Description (EN)
connect(window_name) Localiza a janela, conecta ao processo e ativa o Limbo Mode (oculta a janela). Locates the window, connects to the process, and activates Limbo Mode (hides the window).
refresh() Executa o ciclo completo: Clica em Atualizar > Monitora Estabilidade > Fecha Popup > Trata Erros WebView2. Runs full cycle: Click Refresh > Monitor Stability > Close Popup > Handle WebView2 Errors.
save() Tenta salvar usando Hardware Injection (PostMessage) e Atalhos de Teclado. Não requer mouse. Attempts to save using Hardware Injection (PostMessage) and Keyboard Shortcuts. Mouse-free.
bring_back() Restaura a janela do Limbo para a posição (0,0) na tela principal. Restores the window from Limbo to position (0,0) on the main screen.
close() Encerra forçadamente o processo do Power BI (Kill process). Forcefully terminates the Power BI process.

Contribuição / Contributing

  • Faça um Fork do projeto.
  • Crie uma branch para sua modificação: git checkout -b feature/melhoria-direta.
  • Envie um Pull Request detalhando o que foi feito.

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

phaze-1.1.4.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phaze-1.1.4-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file phaze-1.1.4.tar.gz.

File metadata

  • Download URL: phaze-1.1.4.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for phaze-1.1.4.tar.gz
Algorithm Hash digest
SHA256 d070166a48e9068a1502ec37e957622a5bf4a38f9f5ed6f40833918da0d1f612
MD5 421ad5216e81d6b26e5aa06946c57f5e
BLAKE2b-256 6202453aa0eef07a63a0e42511162eb9eff8c9fbbf74db615f3889da85a4152a

See more details on using hashes here.

File details

Details for the file phaze-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: phaze-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for phaze-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3d93634ff9a7160e1f297ed7c68efb313688d894e7c6019090881bacac501dae
MD5 0a347b7648918aa173a82aa1d7c7bd37
BLAKE2b-256 b355f34302f6b92c2b9edf4ba3f3858f4cd9f680ff66fd1dc3db7fe8c5dfa277

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page