Skip to main content

xa11y

Crates.io PyPI 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

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

pip install xa11y

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

macOS: Grant your terminal two permissions in System Settings > Privacy & Security:

  1. Accessibility — required for all accessibility API access.
  2. Screen & System Audio Recording (macOS 26+) — required to read window content. Without this, only menu bars are visible.

Restart your terminal after changing permissions.

Linux: AT-SPI2 must be running (default on GNOME/most DEs). No special permissions needed.

Windows: No special permissions needed.

Selector Syntax

Query accessibility trees with CSS-like selectors:

Pattern Meaning
button Elements with role Button
button[name='OK'] Button named exactly "OK"
textfield[name^='Search'] Text field whose name starts with "Search"
textfield[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 / activate
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

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 setup.

License

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

Download files

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

Source Distribution

xa11y-0.12.1.tar.gz (349.8 kB view details)

Uploaded Source

Built Distributions

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

xa11y-0.12.1-cp39-abi3-win_amd64.whl (685.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.12.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

xa11y-0.12.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.12.1-cp39-abi3-macosx_11_0_arm64.whl (823.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.12.1-cp39-abi3-macosx_10_12_x86_64.whl (843.8 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file xa11y-0.12.1.tar.gz.

File metadata

  • Download URL: xa11y-0.12.1.tar.gz
  • Upload date:
  • Size: 349.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for xa11y-0.12.1.tar.gz
Algorithm Hash digest
SHA256 216e46a73c09028d05597eb3a965d1ea28df7b69407dfb8c0178c433f85a96ee
MD5 d4a7400c2d929b5bdd6761c9778ce886
BLAKE2b-256 ac2aeac5c260ded483c3bfc431532904caa53135cb9f86420df728c692d04084

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.12.1.tar.gz:

Publisher: publish.yml on xa11y/xa11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xa11y-0.12.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: xa11y-0.12.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 685.6 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for xa11y-0.12.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1608c4067db464e7d4c2053fe7d0f949509cef97bc0a927c461a4a5761e7001c
MD5 526fb3714be407b1459481f9f00f4f4d
BLAKE2b-256 30df0a4f19aa325ab35f64ab1227af0dbe19de374005beac9044cd618d9ad357

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.12.1-cp39-abi3-win_amd64.whl:

Publisher: publish.yml on xa11y/xa11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xa11y-0.12.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xa11y-0.12.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a39b6c934325cb7b81901de6621bb7e544a647ad4a384b33a1580eebdf1008cb
MD5 cb51356fe03055c2769eaa407209b95b
BLAKE2b-256 343f6d1ed1128920e64548f322f2535e17cbb089c095c40c958bf8ce079f9016

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.12.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on xa11y/xa11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xa11y-0.12.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xa11y-0.12.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1ac23cf7df3c689154f840ec276358196e1c83e8144d7f34c90392c3f58da4f2
MD5 fc6dfa7a66ffd8419e578e18e9f57b30
BLAKE2b-256 da4afcb1713e1eba9ae91aa859d1bae41a3de3050504f6838f4605a042cde4bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.12.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on xa11y/xa11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xa11y-0.12.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: xa11y-0.12.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 823.5 kB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for xa11y-0.12.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3f0dea47087d90e82ede6990fc25e4cb44be4d44a5ce1f31ed2f4c36a1444f34
MD5 d46b24d9011a326b72bae51c4bc11949
BLAKE2b-256 d80292404dd763b7ded05462584287133e71113c2a09a6be45d697fe05bf28f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.12.1-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on xa11y/xa11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xa11y-0.12.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for xa11y-0.12.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f08c0a2dbecc22f64f83495bbb023ef38aac0407911e2eab9a1d421fb808b5f8
MD5 17c8f67cd8163cf3fdd67f19a5e92a9d
BLAKE2b-256 0deaecec51c1d9374a4ff1f984413983c8a6553c20a848026c2e0d0fe8a31440

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.12.1-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on xa11y/xa11y

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.14.0

6 files

0.13.0

6 files

This release

0.12.1 This release

6 files

0.12.0

6 files

0.11.0

6 files

0.10.0

6 files

0.9.1

6 files

0.9.0

6 files

0.8.2

6 files

0.8.1

6 files

0.8.0

6 files

0.7.1

6 files

0.7.0

6 files

0.6.2

6 files

0.6.1

6 files

0.6.0

8 files

0.5.3

8 files

0.5.2

8 files

0.5.1

8 files

0.5.0

8 files

0.4.0

8 files

0.3.0

8 files

0.2.1

8 files

0.1.0

8 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