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

# Get the accessibility tree for an app
tree = xa11y.app("Safari")

# Find elements with CSS-like selectors
for button in tree.query("button"):
    print(button.name)

# Interact with elements
tree.press("button[name='Submit']")

search = tree.locator("textfield[name^='Search']")
search.set_value("hello world")

Installation

pip install xa11y

Requires Python 3.9+. Pre-built wheels available for Linux, macOS, and Windows.

macOS: Grant accessibility permissions to your terminal in System Settings > Privacy & Security > Accessibility.

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.3.0.tar.gz (98.3 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.3.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.3.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.3.0-cp39-abi3-win_amd64.whl (268.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.3.0-cp39-abi3-macosx_11_0_arm64.whl (369.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl (376.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

xa11y-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.3.0.tar.gz
Algorithm Hash digest
SHA256 bbc53f12d411f11156f0b36847c29064c53e4c214e54f27cc14036bf08fd5cec
MD5 ce6e5bfdbac5698cf1b2d40af78b31bf
BLAKE2b-256 5472667e84f6f03769107acbff4bce58a6f913da27af986bfd615f7f97c87aec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.3.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 90a182e973d6334dcdc441575b2735a1979f1c6a696c435924c7917d964b53f0
MD5 33630f4540bd4bfe7cef90a48e4dd446
BLAKE2b-256 4e666a9fb31eb4d3597e2a5a3a1caa245fc18b538076787d77cc5d414d0deccf

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.3.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.3.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xa11y-0.3.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3ae4554e282a7f136b207dbf771bf2d135fdf4dc26d11938818880ac7ee3dc90
MD5 65b8c33c602e782595c485554d21c9c6
BLAKE2b-256 852f5e9a7f62f38ec7cb1cedd9b18858309659a5e76a3086cf74d675f554d97a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.3.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 268.9 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.3.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a44a98ae2709ba35df31b9774dc48824889e516d6d580f1e7a851a28c2c4f76e
MD5 5f86a7a26cd3581c8cbdfe9d938dcd3e
BLAKE2b-256 aaa8be3afc40d6d09c0f829cace2bdd2a70524f71111f81a3ec572836bb35421

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cb1e3696fed91b90152de475075d7c269bad1f3f8c7eafb59ff1096b5600c01f
MD5 bab7e74ab43edf4dffc657470876283c
BLAKE2b-256 226f7f33a9aba97b5cf6af1e9c37e9ce040384948e1371fe354e65d1837f0805

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.3.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 369.6 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.3.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d76353b826577663e64260dbb92e38d28bb9f6bc77505006d11eef8c89454cca
MD5 2c859ab4d02dc6efcdeb67593b3c25c3
BLAKE2b-256 4641e5480b47c0718e1bbb2506639636cabcece05b2d573fc38ee258906f2655

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.3.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f761b592249fcb9c855376dc0961d91d4b9eeb725eedc79728b131f692f8f39d
MD5 e133da479d4604a5f71db6a7b7fa7c31
BLAKE2b-256 022d77e3717a9cc8318a2be2e28317386c6a1d62a160de112e1fa5a973d3c979

See more details on using hashes here.

Provenance

The following attestation bundles were made for xa11y-0.3.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.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xa11y-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8bb4680051447838981f4ef2f8e78989ea1059860817e3c305bce5758b30a096
MD5 9ffb57a9ce70274911f0f6069eed9ad2
BLAKE2b-256 f22cb52b9db180b99072e8339bd6df0cb4f29a74fb8d76c67aad3170e9ca3151

See more details on using hashes here.

Provenance

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