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.7.1.tar.gz (221.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.7.1-cp39-abi3-win_amd64.whl (555.7 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB view details)

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

xa11y-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.7.1-cp39-abi3-macosx_11_0_arm64.whl (743.2 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl (760.5 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xa11y-0.7.1.tar.gz
  • Upload date:
  • Size: 221.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.7.1.tar.gz
Algorithm Hash digest
SHA256 f53ba6d6008dcd8991554e385db5217d70b8c5bfab1457f82e65876f52663e9f
MD5 7441632d8018954d8caa057eced76863
BLAKE2b-256 ad446cd6c29cb598b775c649c8fa936210b496e27ca9492d2fc5dd94b44a9378

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.7.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 555.7 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.7.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 29612e3199826cce6ee6e9a0d9f86899b630ad0d902cbe44866583ed4a3317ce
MD5 09f03073a2ddaf6a02d8b599e348ba0d
BLAKE2b-256 33407101e6b5d247f4d50a5eb941bf65dadac8f6c7efa20c211acb6097735b8e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4a43bd6a1276c066079e2c20f403cd280eed052770ee69ac9025ceb04ba91dff
MD5 5af01d5c1a18f9830c70981ceea5ba3b
BLAKE2b-256 3cb0b692de34a9302d586fba795eed95d257584fa0c7f9cf1bcb0f8c40399557

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 624f2fd4c56caad3177e73d437532c3ca0ca3934564c683df524885c50d35694
MD5 fe1d3be0de6c1f1ae31b0943a9128dc6
BLAKE2b-256 346282da1980905ef75ca0a4ec52e6b9350dd7c730f2ac24ab2bf6a03cc8baf7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.7.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 743.2 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.7.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dab2da4b1311b7d9a8762b0ce7df7b59f38fdc859ae99fdc470bb292553664a8
MD5 a0d49fef10a883a6723124b6850cf90c
BLAKE2b-256 2a6711c0a13930128764cfa0a75e0b77add4dd03b70db601b6b673d503e4d865

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eb09c9ff601b6000f3f96506e66f3f0ea64e1215abf15d860ae7cfab8f0af359
MD5 ba101b32770478f7a6430d9162ddd67d
BLAKE2b-256 4ae3bd96580e3887455e282d7ba828136f844af72da08bb991434e1a208563a0

See more details on using hashes here.

Provenance

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