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.15.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 xa11y 0.15.0
File Size Uploaded
xa11y-0.15.0.tar.gz 672.7 kB Details

Built distributions (wheels)

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

Total release size: 10.0 MB

Release files / xa11y-0.15.0.tar.gz

Download URL xa11y-0.15.0.tar.gz
Size 672.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d53e25c4df8f91ac5c3df7e3337d6dd7cad751c498d432f8afac02bfd648ff2b
BLAKE2b-256 checksum
How to use checksums
f91cd3b36d26b6c3e50dffd77bf2c769957729512afa2f0fc3ccff552b59aa95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

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

Download URL xa11y-0.15.0-cp39-abi3-win_amd64.whl
Size 1.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
6717c6d230e9b19ad8ed5ec5f41452910ff8469e5da1a18b3014b91b1b7e220f
BLAKE2b-256 checksum
How to use checksums
16ddf7c68f7a3b828872ae092aa5fff2493fd8bac899875601ab1b8788bf1669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

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

Download URL xa11y-0.15.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a092463bb9c8fd0161e5008ac34e04d58fed4549399990e5d5bcc1c8c383be50
BLAKE2b-256 checksum
How to use checksums
46d3ec739fadf802e71ec18c5d516655fa60aeb061040d2f5678038da4cd2ad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

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

Download URL xa11y-0.15.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.9 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4777b4daad46d6da72d4634db91bdad100c1af54464c16b4d1684cf098d32623
BLAKE2b-256 checksum
How to use checksums
c41079053d57bae0797d4ea7cbb0127620a8823a42a7a1afdc647a9b5af7731d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

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

Download URL xa11y-0.15.0-cp39-abi3-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c5dd0d7056ca677ce0bd80719146446e2601bdeff7f07cc28cc426d600e8c31d
BLAKE2b-256 checksum
How to use checksums
4d4e8c0f04dd9b187eaec5d66b7f65471b275742aa2888fe7b9e9d9cd7225395
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

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

Download URL xa11y-0.15.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.2 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
89085d9197ec6cfb66320977fe17d1f0da1473a015f9bb482cc6f1821fda1a6c
BLAKE2b-256 checksum
How to use checksums
267fca364ab64ca264762ea4fcbaf72fb89dd50bfd78f0af0f6bf94aead954bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

0.15.2

6 release files

0.15.1

6 release files

This release

0.15.0 This release

6 release files

0.12.1

6 release files

0.12.0

6 release files

0.11.0

6 release files

0.9.1

6 release files

0.9.0

6 release files

0.8.2

6 release files

0.8.1

6 release files

0.8.0

6 release files

0.7.1

6 release files

0.7.0

6 release files

0.6.2

6 release files

0.6.1

6 release files

0.6.0

8 release files

0.5.3

8 release files

0.5.2

8 release files

0.5.1

8 release files

0.5.0

8 release files

0.4.0

8 release files

0.3.0

8 release files

0.2.1

8 release files

0.1.0

8 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