Skip to main content
# 👁️ PyA11y (Python Accessibility Adapter)

**A cross-platform UI automation library designed for AI Agents.**

PyA11y bridges the gap between AI models (like GPT-4, Claude) and operating system UIs. Instead of relying on fragile coordinate-based clicks or expensive screenshot analysis, PyA11y hooks directly into the OS Accessibility API to generate a semantic, lightweight JSON representation of the screen.

> **Current Status:**
> * ✅ **Windows:** Fully supported (via UIAutomation)
> * 🚧 **Linux:** In Development (planned X11/Atspi support)
> * 📅 **macOS:** Planned

## 🚀 Installation

```bash
pip install pya11y

⚡ Quick Start

PyA11y separates the "Driver" (the OS interface) from your logic. Here is how to snapshot the current window:

import time
from pya11y import get_ui_driver, ScanConfig

# 1. Configure the scanner
# Scan 10 levels deep, ignore clutter like ScrollBars
config = ScanConfig(max_depth=10)

# 2. Get the driver for your OS
driver = get_ui_driver(config)

print("Switch to your target app in 3 seconds...")
time.sleep(3)

# 3. Capture the semantic tree
ui_data = driver.capture()

# 4. Use the data
print(f"Captured Window: {ui_data['name']}")

if 'children' in ui_data and len(ui_data['children']) > 0:
    first_child = ui_data['children'][0]
    print(f"First Element: {first_child['name']}")
    print(f"Coordinates: {first_child['bbox']}")

🧠 Why PyA11y?

Most automation tools (like PyAutoGUI) are "blind"—they just click X,Y coordinates. If a window moves, they fail.

PyA11y provides Context:

  1. Semantic Tree: It tells you "There is a 'Submit' button at [200, 400]".
  2. Token Efficient: Outputs clean JSON, not heavy screenshots.
  3. Resilient: If the window moves, the underlying tree updates automatically.

🔧 Configuration

You can fine-tune the scanner to save tokens or get more detail:

config = ScanConfig(
    max_depth=12,              # How deep to scan nested elements
    include_offscreen=False,   # Ignore hidden elements to save space
    require_text=True          # Ignore elements with no labels
)

🤝 Contributing

We are actively looking for contributors to help build the Linux and macOS adapters!

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/linux-adapter)
  3. Submit a Pull Request

Release files for py-a11y-ui 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-a11y-ui 0.1.0
File Size Uploaded
py_a11y_ui-0.1.0.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-a11y-ui 0.1.0
File Interpreter ABI Platform
py_a11y_ui-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / py_a11y_ui-0.1.0.tar.gz

Download URL py_a11y_ui-0.1.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
56c92bc6ee342f46477196ecbc9eea0c08b591b78c6d5db22fffe4a6d056f04f
BLAKE2b-256 checksum
How to use checksums
d7f25438c4c8018aa33ba916fe976b3d11e254efb5c561148901cce3bdf25936
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / py_a11y_ui-0.1.0-py3-none-any.whl

Download URL py_a11y_ui-0.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8193a2c8250b513dc21bf963574864b8f9d7014c073cb88b1064ff1b7b573d41
BLAKE2b-256 checksum
How to use checksums
ce00036caa90788b68224a2db44c59979902ac41e2eb2de40b028a1b2730a031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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