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.3.tar.gz (115.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.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.5.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.5.3-cp39-abi3-win_amd64.whl (384.2 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.5.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.5.3-cp39-abi3-macosx_11_0_arm64.whl (554.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.5.3-cp39-abi3-macosx_10_12_x86_64.whl (566.4 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

xa11y-0.5.3-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.3.tar.gz.

File metadata

  • Download URL: xa11y-0.5.3.tar.gz
  • Upload date:
  • Size: 115.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.3.tar.gz
Algorithm Hash digest
SHA256 4eca48bf99246b84eb64ec88aa13fc99ebfadc8ad0d6c05a5c9536530b9ebb1c
MD5 f8fe74afb07f2380457e52fa801859d3
BLAKE2b-256 d7f35ee81b4fdcabe55d88e81a921cdebc1df98fea4d50f5f03917b46c9a5b2b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8ed3a1ecc8be2c4392b197123cd4deb44be0205672769c7dee0ea9f9cbdf4465
MD5 e021c49b5f2acfbecf97a09a72f6b78f
BLAKE2b-256 3f032c6bb4f65df500fc3d6534e349b07d38ce4c0bdb5ab91e1f72b0725ce855

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2ab906b6b3f01b85cc42b2ec64808eb2956ec464998deb119d6710d5fbc1ebd0
MD5 ad8c07cd62373808b823a35bbe661cb9
BLAKE2b-256 abab3d18f793fbedbb06c9b6777c6d1b68e4d4459d181786c925d0261c30105e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.5.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 384.2 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.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 13dc6112dbe5676bc395b77accdc41453350b7f099c09b4e3fff14bca1d0ca58
MD5 53d4402fa02608cd6aa032d2e03411ce
BLAKE2b-256 f39cdbd8db312a944636f542e1b1ba58e612cb7a5a0b50d28d43e8c0f20d086e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9765dfdded38ea170c7f86eca4fb936342b168b384eb5959c409eec8f5ba7104
MD5 25666e080dd9c7c0ede6da9ffab615ef
BLAKE2b-256 f2740261eacab94c2516ef198004cd9122df53427aa26a452b2dd667a7bab2b6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.5.3-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 554.3 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.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 76af71aac11954fa0df71aed76bc4a26c69e0329319c75d48fcc3f5c038bc6fe
MD5 caac4ef1b6f5ddbb2f02d857b21939b4
BLAKE2b-256 86537aad1b22dbbde9e227ae0124e1bf4b21f1fa5a6dea8adf8cab2a3070bab6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e7264435fa0f1cd6383c97405d2181e4afe11c02c475312e8732a530dcb25d5a
MD5 7a94c570d2d204bf0dcd34ffe14b820c
BLAKE2b-256 f62735a318de8027d35c169f903bf1b3a8ab5d7e261051c359b4e1d8ef200106

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9a088dacb2cdc7512e7f30dd027675dce1863317b1ff2679d2b6cd62b73d2d09
MD5 5460ee46036a8d1916006c3b87a9d65b
BLAKE2b-256 619b5d1d9b2edbfbfd2c9f594019f55fb0b79e36c497f32c8148c5c5ba88553d

See more details on using hashes here.

Provenance

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