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.

On 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 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"
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.13.0.tar.gz (361.9 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.13.0-cp39-abi3-win_amd64.whl (685.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.13.0-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.13.0-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.13.0-cp39-abi3-macosx_11_0_arm64.whl (822.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.13.0-cp39-abi3-macosx_10_12_x86_64.whl (843.9 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.13.0.tar.gz
Algorithm Hash digest
SHA256 5598d97736523c0f20bf6ad6d129d270b762b1a469879093fde97bc0b04098af
MD5 9e847858458a71d807b4b666ef15d9e3
BLAKE2b-256 02f006228e80e8cc3bfb05da10805c451e416880c817cb57ca2873a13926d222

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.13.0.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.13.0-cp39-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for xa11y-0.13.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 326d30566e5dbff9f9838e93a69db05a6b69892bfe8603ed7ed1013ae6e5da25
MD5 a69b732d99fccc71825a46805fe3b373
BLAKE2b-256 97f736a50c34bf05d55357c8fce100cca6d1736b0d5038ebdf865294a42de1fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.13.0-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.13.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xa11y-0.13.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f26ffaabf94055d6e8eaa1ddf658f7a1a78dd60e4914dfae44e2940fb66f9c11
MD5 3eb83d0dfabda16a059d6208b155daaa
BLAKE2b-256 6f27abdb38f863a5c5a6dd9e14f78ef69728e62cba25bde5ec919012d9394b32

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.13.0-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.13.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xa11y-0.13.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c80742132a611c88f02bab83586790523ce3aca6801393476a6e2bcf5e8b9b04
MD5 05d808b6adce5badceb81092a250a57d
BLAKE2b-256 a5cb630da8c01363b5981e80f87c37dc55392c4ab8c5572016682bbdc3016fa5

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.13.0-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.13.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for xa11y-0.13.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 600c5e9a2f4f70a31676e696ea3819b6e0640d41e9d7dcc292a7945d12f72fb7
MD5 1c5e5e74ab4f8ba4c8354796f7d8e7d4
BLAKE2b-256 a39fe062907347fe09079288bde22184731b0f9f28e68f219d6f783a83e4531e

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.13.0-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.13.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for xa11y-0.13.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2b63366eec1192a2f922f63955bf79797ecbde99d2716b7429f0492331eed3e7
MD5 cca353785e5725ec0f160cb2b5582136
BLAKE2b-256 596902bf42af092cdb3df46363ae80ffbe26b3263179140eaf09e62008f2af06

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.13.0-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

This release

0.13.0 This release

6 files

0.12.1

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