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
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.8.1.tar.gz (262.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.8.1-cp39-abi3-win_amd64.whl (622.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.8.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.8.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.8.1-cp39-abi3-macosx_11_0_arm64.whl (791.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.8.1-cp39-abi3-macosx_10_12_x86_64.whl (809.8 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.8.1.tar.gz
Algorithm Hash digest
SHA256 4a9588162546a2b5fe5d68e20d13dc603feb0b95c1f5123c2df7bf05bc336c81
MD5 d48d8f5640e245d1c1eeee98538978a8
BLAKE2b-256 cece5a57c7496bbf28c2a487e94b96627579ccc9ef598a50c68c7d89a144a01a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.8.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 622.6 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.8.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0cdc3f4042d888c4e0837b0217498541d90b7784b6abbad112182ef2892f8435
MD5 1e3f0a7e42cb2a28df2ba2f7cf2b89bb
BLAKE2b-256 fad3a74a6bdeb5dd19849fd15bbc1acb1fc5eba67db37b0d7d6b2c32bc335d9d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 af85d13049f4ba58b328d84ea665da594506d93c2ad701358c7a176e4270dc1e
MD5 e91ecc547d22f724eee5364d11eaa198
BLAKE2b-256 8214e7c456357b7d54ca6812e106635782a036bd3282259c397719b152b68b6f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 03c08e19d91c569b42cc75d47da6f9509c8c777e79ec95a24802f270bcd2d6cb
MD5 0d6a8a4e55c922e5b560def171beeb8a
BLAKE2b-256 164919aae1bf5bbb9e8a8355a7fc23225af5d6152e5cb15b1d272677d350c86f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.8.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 791.5 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.8.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 69407ab2c30f46c571456653bec821a605bc6329522455e93630aefed1159491
MD5 c1f6974e1b0f81b88499775a7243dbf5
BLAKE2b-256 072d2e21b18180eeafdc9ba9f06cab5b989c7f0b0db352c5f3e23a03bc972d38

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 79bfc42c1c610331687b68d6b9e3d98c5f01e1f588992a055e23c353a8eed0fa
MD5 381b4c59aa8bbb2703d54fe595aadd14
BLAKE2b-256 3bab744b1c9418a9fb4d4282b1b6ceb824c32e37bc2dd2a9d480318dbcb3b6fd

See more details on using hashes here.

Provenance

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