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

# Find elements with CSS-like selectors via locator
app = xa11y.locator('application[name="Safari"]')
for button in app.descendant("button").elements():
    print(button.name)

# Interact with elements via locator (re-resolves every call)
app.descendant("button[name='Submit']").press()

app.descendant("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.5.0.tar.gz (101.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.5.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.5.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.5.0-cp39-abi3-win_amd64.whl (368.7 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.5.0-cp39-abi3-macosx_11_0_arm64.whl (493.4 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl (503.7 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

xa11y-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.5.0.tar.gz
Algorithm Hash digest
SHA256 90ec47ce0afa405b61107d1dd261968104a0e6b34a97a6b43cc711637e5f87da
MD5 3bbb4f087ffc5889b7602ba961baa2a1
BLAKE2b-256 7027af8e3074b5e5a7549de5c223e5498e8a427c37a3ac999a98188e00c18876

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.5.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.5.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xa11y-0.5.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5d3264e56082a7bd3f24a4914a9f60e6d8f5dd686cbec179f356f1171d5c35aa
MD5 fe6cad43c9a681f36a3d4ce5a09d2d6e
BLAKE2b-256 fdf78ada38b97e8874942c2a445d0a4a3495c4037adc726e3f94733b136b726a

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.5.0-pp310-pypy310_pp73-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.5.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xa11y-0.5.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5b3431e68496ed42fc2f4a1d86bb67c2197778c750f5e8be502d8a3ef8ccc016
MD5 9a3fba165c5c5bcf5848fb21fa78fe94
BLAKE2b-256 ab2540d32716e9cf409771486fe7047621abe278d2ba8e3662a7af6c0e7797cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.5.0-pp39-pypy39_pp73-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.5.0-cp39-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for xa11y-0.5.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7efc2bdce39197ae7fa31c16d0ba6c822e4a722cb9b96d4b31833b14ec30c2f1
MD5 90764277d63856ef162c8185bdae3fdb
BLAKE2b-256 af5c70feeaf3ee1abcb8d360cdb2dccfbb4a4550709691c817d62503041152a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a82df9dbe4e040e33f5f9c560d2ea7a11fc401ff10ace526264a23d5409281c8
MD5 134822cf9e2b17d57a56a86d4f59f782
BLAKE2b-256 19d8d99947487b46343fa72659f19ad5247690abcaccf4a8c4e52a9f11b8fd04

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for xa11y-0.5.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9712a8d87f916d5511050667aee26147e7693f1be502deec49979273c128e459
MD5 62fc80d9c2be122a8bc7cc41d1f1fae8
BLAKE2b-256 cedb67662f4f6be8e037f17bb48c96c3de474fbbf515adc547ca0b76411ec092

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d4f038b8549eaabdac35e1317816de58966932fc7d335e98ed4e31a0d9b816a7
MD5 afffe3819b135137342df27dba1f82b1
BLAKE2b-256 1d794264efb3af06f4194506c9807c77aff4f7dfac29505811c173005290cb7a

See more details on using hashes here.

Provenance

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

File details

Details for the file xa11y-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xa11y-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 43dac89df717ef054eadb69b0f37552376cfedae4723e2eb9e22680ecac455a1
MD5 9041bae93a22a96927dfc73e9a8c8681
BLAKE2b-256 b2fcfb1384fa5eef894eb504a0ab144eb52e07ed2e8ae21ac6a727b7cc806356

See more details on using hashes here.

Provenance

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

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