Skip to main content

xa11y

Crates.io PyPI npm CI License: MIT Docs

A Playwright-style library for driving native desktop apps on macOS, Windows, and Linux. Built for end-to-end tests, computer-use agents, and assistive tools.

Use cases: end-to-end desktop testing, computer-use agents, MCP tools, assistive technology.

Documentation | Rust API | Python API | JavaScript API

Quick Example

import xa11y

safari = xa11y.App.by_name("Safari")

# Find elements with CSS-like selectors via locator
for button in safari.locator("button").elements():
    print(button.name)

# Interact with elements via locator (re-resolves every call)
safari.locator("button[name='Submit']").press()

safari.locator("text_field[name^='Search']").set_value("hello world")

Installation

Python

pip install xa11y

Requires Python 3.9+. Pre-built wheels available for Linux, macOS, and Windows.

For pytest suites, pytest-xa11y adds fixtures that launch the app under test, capability markers that skip what the machine cannot do, and the accessibility tree on every failure:

pip install pytest-xa11y

On macOS, grant your terminal two permissions in System Settings > Privacy & Security:

  1. Accessibility, required for all accessibility API access. On macOS 27 and newer, grant it in Device Control and Data Access.
  2. Screen & System Audio Recording (macOS 26+), required to read window content. Without it, only menu bars are visible.

Restart your terminal after changing permissions.

On Linux, AT-SPI2 must be running (the default on GNOME and most desktop environments). Nothing else to grant.

Windows works as installed.

Selector Syntax

Query accessibility trees with CSS-like selectors:

Pattern Meaning
button Elements with role Button
button[name='OK'] Button named exactly "OK"
text_field[name^='Search'] Text field whose name starts with "Search"
text_field[name*='email'] Text field whose name contains "email"
group > button Buttons that are direct children of a group
window button Buttons anywhere inside a window
button:nth(2) The 2nd button match

Supported Actions

Action Description
press Click / invoke
focus / blur Move or remove keyboard focus
toggle Toggle a checkbox or switch
expand / collapse Expand or collapse a disclosure
select Select an item
set_value Set a text field's value
type_text Type text into an element
increment / decrement Adjust a slider or stepper
show_menu Open a context menu

Platform Support

Platform Backend
macOS AXUIElement
Linux AT-SPI2 (D-Bus)
Windows UI Automation

Ecosystem

  • strands-xa11y packages xa11y as a desktop-control tool for Strands, AWS's open-source SDK for building AI agents. One tool gives an agent the accessibility tree and the actions on it; a read-only variant covers agents that observe and never act. pip install strands-xa11y (requires Python 3.10+).
  • agent-desktop is a CLI built on xa11y for AI agents that read and control desktops.

Contributing

git clone https://github.com/xa11y/xa11y && cd xa11y
cargo build --workspace
cargo xtask check   # fmt, lint, test, python bindings

See the development docs for architecture and testing strategy.

License

MIT. All dependencies are permissively licensed (MIT, Apache-2.0, BSD, or similar), enforced via cargo-deny.

Metadata

Release files for xa11y 0.16.2

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

Source distribution (sdist)

Source distribution for xa11y 0.16.2
File Size Uploaded Provenance Actions
xa11y-0.16.2.tar.gz 1.3 MB With provenance Details for xa11y-0.16.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for xa11y 0.16.2
File Actions
xa11y-0.16.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for xa11y-0.16.2-cp39-abi3-win_amd64.whl
xa11y-0.16.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for xa11y-0.16.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
xa11y-0.16.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for xa11y-0.16.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
xa11y-0.16.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for xa11y-0.16.2-cp39-abi3-macosx_11_0_arm64.whl
xa11y-0.16.2-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for xa11y-0.16.2-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 15.2 MB

Release files / xa11y-0.16.2.tar.gz

Download URL xa11y-0.16.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
1888e5e9612a8d5e57569baf67ec07d9c9de1f83144db996054b4ce536e45a2e
BLAKE2b-256 checksum
How to use checksums
46fb1be51bc2e014294999b83e389a3e41bdb7dce8f28a26514e5e70ab465fa9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / xa11y-0.16.2-cp39-abi3-win_amd64.whl

Download URL xa11y-0.16.2-cp39-abi3-win_amd64.whl
Size 2.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3687edbf4324098bd2c3c9dc2d72eac14848b851b725e1db72a57aa411dfb951
BLAKE2b-256 checksum
How to use checksums
85230872639509b161c67ce18a222af15b425d5f2749930d3de65458d473b22b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / xa11y-0.16.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL xa11y-0.16.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 4.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b58af776b3db15223ae8587be4eba6d179e1e501aa843055aa44b17e3d4fb862
BLAKE2b-256 checksum
How to use checksums
336c6f547d4aa28afa0393bc74d88d2947a3b41f99bbe1aaa53ceca955d5b775
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / xa11y-0.16.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL xa11y-0.16.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.9 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4b2de3ed6809be0123eb0df6dba898ddbe9dedff9af653b3f40b8c1ea3d2d1be
BLAKE2b-256 checksum
How to use checksums
272825bdd6f3f85f61ded9dfdd2c8e8f077b508d67ffc0ce833874d459a7be1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / xa11y-0.16.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL xa11y-0.16.2-cp39-abi3-macosx_11_0_arm64.whl
Size 1.9 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
468f56fd3e0d069c09774ce30a73693922e6b8b409cdc249412a355f6261b112
BLAKE2b-256 checksum
How to use checksums
2a377a5a4407ff3888669202c5954261c9a6a039879a6d02195e6773a72fea48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / xa11y-0.16.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL xa11y-0.16.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 2.0 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6525e41ce217f7453a544c1973e0f7522d21168d9604d6d2be9624f9fb6a96b2
BLAKE2b-256 checksum
How to use checksums
a1ab6c65cc27fd5db9862fca1cfcedd5552e63d5572a1d0695698b1262414dd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for xa11y 0.16.2

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.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for xa11y-0.16.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.16.2 This release

6 release files Full provenance

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