Skip to main content

pyautoassist

Playwright-style desktop automation with native OS accessibility backends.

pyautoassist brings the developer experience of Playwright to desktop automation. No more time.sleep(). No more fragile coordinate-based clicking. Just explicit locators, native auto-waiting, and real OS accessibility APIs.

import pyautoassist

app = pyautoassist.using_backend()

# XPath-style locators targeting OS accessibility properties
app.locator("//Button[@Name='Submit']").click()
app.locator("//Edit[@AutomationId='email-input']").fill("Hello World")

# CSS-style shorthand
app.locator("button.submit-btn").click()
app.locator("edit-text#main-input").fill("Hello")

# Auto-waiting: no time.sleep() needed
app.locator("//Button[@Name='Save']").click()  # waits until clickable

Why pyautoassist?

Feature pyautogui pywinauto pyautoassist
Locator style Coordinates/fragile selectors Custom syntax CSS/XPath-style
Auto-waiting None Basic Full (Playwright-style)
OS backend Screen capture Win32 COM Native UIA/AX/AT-SPI
Cross-platform Yes Windows only Windows/macOS/Linux

Installation

# Core (auto-detects platform)
pip install pyautoassist

# Platform-specific extras
pip install pyautoassist[windows]   # Windows UIA
pip install pyautoassist[macos]     # macOS Accessibility
pip install pyautoassist[linux]     # Linux AT-SPI2

Quick Start

import pyautoassist

# Create an automation session
app = pyautoassist.using_backend()

# Find a window
notepad = app.open("Notepad")

# Use locators (auto-waits for element)
app.locator("//Edit").fill("Hello, pyautoassist!")

# Chain locators within elements
notepad.locator("//MenuItem[@Name='File']").click()
notepad.locator("//MenuItem[@Name='Save']").click()

Selectors

XPath Style

Target elements by their OS accessibility properties:

# By control type and name
app.locator("//Button[@Name='Submit']")
app.locator("//Edit[@Name='Username']")

# By AutomationId (most reliable)
app.locator("//Button[@AutomationId='btn-submit']")
app.locator("//Edit[@AutomationId='email-input']")

# By ClassName
app.locator("//Pane[@ClassName='Notepad']")

# Chained: nested elements
app.locator("//Pane[@ClassName='Notepad']//Button[@Name='File']")

CSS Style

Shorthand selectors for quick access:

# Type + ID (AutomationId)
app.locator("button#submit-btn")

# Type + class (ClassName)
app.locator("button.submit")

# Type + attribute
app.locator('button[name="OK"]')

# Child combinator
app.locator("pane > button")

Supported Control Types

button, edit/edit-text/textbox, pane, window/dialog, menu, menuitem, checkbox, radio/radiobutton, combobox/dropdown, list, listitem, tree, treeitem, toolbar, tab, tabitem, image, hyperlink, slider, progressbar, scrollbar, group, tooltip, statusbar, header, separator, document, dataitem, custom

Auto-Waiting

Every action on a Locator automatically waits for the element to be ready:

# Waits up to 30s for the button to exist, be visible, and be enabled
app.locator("//Button[@Name='Submit']").click()

# Custom timeout
app.locator("//Button[@Name='Submit']").with_timeout(5000).click()

# Wait for specific states
app.locator("//Button[@Name='Loading']").visible().click()
app.locator("//Edit[@Name='Email']").enabled().click()

Element Actions

el = app.locator("//Button[@Name='Submit']")

el.click()              # Left click
el.double_click()       # Double click
el.right_click()        # Context menu
el.fill("text")         # Set value (input fields)
el.type_text("text")    # Type character by character
el.clear()              # Clear input
el.select_option(label="Option 1")  # Dropdown selection
el.focus()              # Move keyboard focus
el.hover()              # Move mouse to element
el.press_key("Enter")   # Send key press

Window Management

# List all windows
for w in app.get_windows():
    print(f"{w.title} (PID: {w.pid})")

# Find by title
notepad = app.find_window(title="Notepad")
notepad.focus()
notepad.move(100, 100)
notepad.resize(800, 600)
notepad.close()

# Find by PID
window = app.find_window(pid=12345)

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyautoassist-0.1.3.tar.gz (70.0 kB view details)

Uploaded Source

Built Distribution

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

pyautoassist-0.1.3-py3-none-any.whl (63.3 kB view details)

Uploaded Python 3

File details

Details for the file pyautoassist-0.1.3.tar.gz.

File metadata

  • Download URL: pyautoassist-0.1.3.tar.gz
  • Upload date:
  • Size: 70.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for pyautoassist-0.1.3.tar.gz
Algorithm Hash digest
SHA256 937a9ad91fc88ed7d155fad7bae4f772b4cfd0fb51478d218448d1c51d47a2ca
MD5 5ec68b18131b4140a826cf3db1ae5fcc
BLAKE2b-256 e53421195e4ed390e49acb2472f1ef8b52bc99d87bb74409b216fa3ea59a8363

See more details on using hashes here.

File details

Details for the file pyautoassist-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyautoassist-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 63.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for pyautoassist-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 beb4e8b27b1e920f3a522eb16fa652f911c3d47c16be8b4e5eb0cc420af4f87a
MD5 79d72e01b680677b1650d71060338bf7
BLAKE2b-256 9e39abb8ce1e3a7e03f8687332fafaa755e8ffb6e63e583250aad076bfccfe1d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page