Skip to main content

Cross-platform accessibility client library

Project description

xa11y

Crates.io PyPI CI License: MIT Docs

Cross-platform accessibility library for reading and interacting with accessibility trees. One API for macOS, Windows, and Linux.

Use cases: UI testing, AI agent tooling, assistive technology, desktop automation.

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
scroll Scroll in a direction
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.6.2.tar.gz (126.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.6.2-cp39-abi3-win_amd64.whl (445.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.6.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

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

xa11y-0.6.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.6.2-cp39-abi3-macosx_11_0_arm64.whl (613.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.6.2-cp39-abi3-macosx_10_12_x86_64.whl (628.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xa11y-0.6.2.tar.gz
  • Upload date:
  • Size: 126.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.6.2.tar.gz
Algorithm Hash digest
SHA256 d07c48f29e48103ab0b764a8b651bff2daff4999914c808726160c96f2926875
MD5 7b6fcced8c4d4423ae943a6f12e1e61a
BLAKE2b-256 cb73d645e423ff2bc2731e2d10b15d21840f39d87ed9473d2f152004591ccdc9

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.6.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 445.0 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.6.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e871fd345f9e65875df606ab92bed742ac2f9c36c8aeb34cafeb61abeae90ce2
MD5 c14a60742d6dbfdca7a3b98d54977561
BLAKE2b-256 cfaaae2bcd4ab24d95958e5f4271fe542fd83d63439b7cc7d4edd3de8b215e1d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 054663f0439e265d162d23ed0bd87065f9742682e9894747e088e238307ccf3b
MD5 3efab54e11f0decbf99f37239b405c39
BLAKE2b-256 94f12bb80843ea910b2d606817e046b7ce61ee033aa761b03023befe74077e9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 09d4332fd8c6a9857f327d90d3dc5b4b299e8d3ff9eddca534ae78ce97460aef
MD5 4bf7530e9f25f59569329d8526098fd2
BLAKE2b-256 b3c78d1bf479068b299739fadf7755973807f95e616b7cc9190facfa8cb158e8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.6.2-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 613.6 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.6.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8ace1df01a9e85537c52ebb742cb6aca26774207c77f3bd595f39d06469ed172
MD5 cdd54164586344ec584f080ed5e228b9
BLAKE2b-256 0590018a5849d7b92449ffa7dd9195eec5b46967a8eb942b23b408c1c51a8afd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aa2b74e37f6602ecf799b60a3ce8daf97b1715be428a1b0fbcfd58982fca5130
MD5 6fc2992abe8b9a3f91f6654e8847ef15
BLAKE2b-256 874b86cd5680c2c21238f24ffd1e6fbeda9c4474802a78f4aa334ad0ff8be6ec

See more details on using hashes here.

Provenance

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