Skip to main content

Cross-platform accessibility client library

Project description

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.

Project details


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.9.1.tar.gz (308.5 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.9.1-cp39-abi3-win_amd64.whl (675.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

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

xa11y-0.9.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.9.1-cp39-abi3-macosx_11_0_arm64.whl (822.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.9.1-cp39-abi3-macosx_10_12_x86_64.whl (843.4 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.9.1.tar.gz
Algorithm Hash digest
SHA256 995867fdb86d93efb2199bf57ec6a2d66bb65b02a7b72cef958084bad05b2bc1
MD5 1665e97df11d88ac020197bf76378a6d
BLAKE2b-256 fce3ea96c0ae1ee88fefdc610e48ea62c5bbf554c2076daf102c28ae0a605777

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for xa11y-0.9.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ad379f1f76cca061114cc6c08c5add8aacd7d012cf017f1423172b5054c08fb9
MD5 7ee2b6d842726f312c0cd3e912ce0c6d
BLAKE2b-256 d2cb40c1b73192d5131fe303b8019aedabef6a5e835653fa563dacfaac2c7184

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5a8336142d07661ed2641708690efc22327b675d2358fcb8ef879c65274e5c3
MD5 f53644b19b9f3e573456139642c5715f
BLAKE2b-256 98f2c9c36b556fe7d0728c18d0c4b5a17e41c7c2c5f5ec743c9c00ce32ad0137

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.9.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9610b78ef255c3637fd5937b5a4bca82b803744dac2cf73f5b1a0fe3dd38b33f
MD5 fd9832a7401f1fa2dda14a19ae2982cd
BLAKE2b-256 b01df307d2521de61dfae39e72cd181e328e6ef66603a581ded499d7480bf622

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for xa11y-0.9.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4853c284449a0e451095b8948675e8b1f527c291f2cd5cb3826fc1e12be24a43
MD5 35d6d257548a7dbb9013ee5cd97f9219
BLAKE2b-256 0952f465966831dc3b5c72a5bcd62b4de782fea3cb0228f24f595abd5338adb8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.9.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8c1cd290d18c7fc2a6f2f1e77092493c96487fb7b7108949557e9b5dda079e74
MD5 572edf47cb284a6a3a1c3c64e29b1da5
BLAKE2b-256 814e4c67459a8114248aef1e9dd014266031a38b2fae3149858585303f2a2750

See more details on using hashes here.

Provenance

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page