# 👁️ 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:
- Semantic Tree: It tells you "There is a 'Submit' button at [200, 400]".
- Token Efficient: Outputs clean JSON, not heavy screenshots.
- 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!
- Fork the repo
- Create your feature branch (
git checkout -b feature/linux-adapter) - Submit a Pull Request
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_a11y_ui-0.1.0.tar.gz | 6.9 kB | Without provenance | Details for py_a11y_ui-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_a11y_ui-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for py_a11y_ui-0.1.0-py3-none-any.whl |
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
|
Security for py-a11y-ui 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.