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.5.1.tar.gz (102.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.5.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.5.1-cp39-abi3-win_amd64.whl (376.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.5.1-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.1-cp39-abi3-macosx_11_0_arm64.whl (502.7 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.5.1-cp39-abi3-macosx_10_12_x86_64.whl (511.9 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

xa11y-0.5.1-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.1.tar.gz.

File metadata

  • Download URL: xa11y-0.5.1.tar.gz
  • Upload date:
  • Size: 102.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.5.1.tar.gz
Algorithm Hash digest
SHA256 25e5a88eac95e1ef5859a4db4255b4c0f2b77d6abb14189b29f2d2b3d002db61
MD5 e614b5c60462d98b73dc0472094f24b0
BLAKE2b-256 87b9b73bb0fcc638bf7e0bc9986ca44a06553e65de1f7880f42fcc2e59709b71

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f999314c5d832826fee03200e0e70bf9969b3797013e9cf7a2743a3fd43cdecc
MD5 e2360888d2dacd547c0fd9a8854cebf8
BLAKE2b-256 dbf4657717dfab3cdc71d7a7b75ca2d0a44f4d77b6557d6f2771f7ab98589064

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5736f771719f72629e3aa674aa87864e74fafd3047f3ae9d364bf2ab618a207a
MD5 0fbfac939016011e7dae92fb18dbd41a
BLAKE2b-256 a3b99541bd59d23210f59b8e85a0988da02a74e60da0b25fd098a4002069cc16

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.5.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 376.4 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.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f3528e88c637be6da2f907f56ab3af4f67059f043ee89c9f103005f9ade6da06
MD5 d0acde543b5c24b2d75ed32e60fdb456
BLAKE2b-256 9d1ba8a2303cb5c0d5a1537827e0d5872447849c81eadc933722a4536fb6e874

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 85a80b71a198a67a0e1c04c783e4a6e3f3d7797bb55ce6bd02f03493f7150661
MD5 b538c619d007deb46387ced355505772
BLAKE2b-256 6ac86515056a065284c96ac0a1596fba86eac1b0681e2945a0000811ec2bd81d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.5.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 502.7 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.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4174d840989a3a9f5d83409e3843c5a3b5fdd98843d49cad37ebadb9c022cf36
MD5 f13c3ea32211ec7443d6e47e393ffa7c
BLAKE2b-256 3b25cdd0b803b471cceb0fd89aeb65832779cdc507b29a1eb3eb9d59d6256588

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0d68ab03c884096bee1dd8d9ad90689f3eaba92f238289efe19b019151c8fcf1
MD5 f1e6c37bfadf6fd038bfb032a2679acf
BLAKE2b-256 6ed99037f923f16991d2575888a6e252d67abd95c633c80daa4a025af7fb2272

See more details on using hashes here.

Provenance

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

File details

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

File metadata

File hashes

Hashes for xa11y-0.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9af906c0be236bfc99bc2a80f106b6fcc168ddb1ed99f2a0f706ced57049f857
MD5 a9f85d100f4aa5b169be9db55f1a1509
BLAKE2b-256 a5249794e7c91e675ba6054d16d3d953277ebefd1f6060be187625e2f65ac214

See more details on using hashes here.

Provenance

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