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.0.tar.gz (344.7 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.0-cp39-abi3-win_amd64.whl (675.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.12.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.12.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.12.0-cp39-abi3-macosx_11_0_arm64.whl (814.9 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.12.0-cp39-abi3-macosx_10_12_x86_64.whl (836.4 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xa11y-0.12.0.tar.gz
  • Upload date:
  • Size: 344.7 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.0.tar.gz
Algorithm Hash digest
SHA256 0be228c49e9e81d0cd4beb451e8c627161336a47d7e879dd9e29b052f15c9b20
MD5 50d0504709464ecda540ee1f7c605d34
BLAKE2b-256 520b416d824f1fc6efa1d3b585a0b46d044df10ff72ea6afeef9c557e882b317

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.12.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 675.4 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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b1ecb2c0bab3ea85a0e5081fd617766427fac787ee152d882afa87b97d5bfba7
MD5 bbe065c91e5fc9649c43676d34d9ff05
BLAKE2b-256 b526ee37197416829cf840a2d665a00bbbb10948c9c0055d637c1d6b3d2017c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.12.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 264f24a05114148b8ecc2e9ab41fdd95fb4828240219b7c7e77d0b36bc4d6deb
MD5 01b3bc67589cfe46d78ba0d4b021e4cc
BLAKE2b-256 082de387836b7b40d29657e710321fb74305a04986193bc573a6f89ae77a89b9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.12.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4c6ddc8ee8749ebf135979f91ffef7b83afc6ffb16b6a76ece261126be6b3269
MD5 b80ddccc68eeb7e24133f1f7da8fe7b0
BLAKE2b-256 f1234b41332b45adee50717c074cbfbadecba60d0950fbd16e959be2661856b5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.12.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 814.9 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.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 791a758cddff557b22e87743df9f6ff6b50ce912935c0bb3242b5f899d131fb8
MD5 47c351d683f1a5ae7c7b12137fc62e51
BLAKE2b-256 360589eab7dea52fc84561048a7918c1d6f85186ebe12b6fce8a07d7cd344ee0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.12.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8f21fe4686975c1f147c51daf712c1e15ed20cc46a4aa9667e07ce67c1beafc4
MD5 5916e264e8dfb59d9c511821a975f1f8
BLAKE2b-256 b78b26cc10f6401b86c6b414a7eb6b5f79b09edede2567df02f31e648fd6e1b9

See more details on using hashes here.

Provenance

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

0.13.0

6 files

0.12.1

6 files

This release

0.12.0 This release

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