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.0.tar.gz (212.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.0-cp39-abi3-win_amd64.whl (554.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

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

xa11y-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.7.0-cp39-abi3-macosx_11_0_arm64.whl (743.0 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl (761.2 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xa11y-0.7.0.tar.gz
  • Upload date:
  • Size: 212.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.0.tar.gz
Algorithm Hash digest
SHA256 0bda16c91f27789ef64f0c3bff639f00a9de43bc6bbaf99d641dc027e0e0cabf
MD5 e2c2758998c2b54956225f8075abfd52
BLAKE2b-256 d52967df88bfbe2de8b972a2e19aff7b1f97812e6c7c587d427aeb5782e04f14

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.7.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 554.9 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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2cddaab0a8ca7ae5e68982c8147d15d387aee8866e22da249261744e1b9ee7eb
MD5 08ce62a7ac1761875a131e33dba45803
BLAKE2b-256 b76c3157f0ecbb2d61584dd34d2c28ec925cf4a384ef83428950181d56bb5e83

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.7.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d633f49fd80057a0e82c763790ff0f5dc145c15588738206b6e68ce6a1c89bd1
MD5 db23247315079828e2f53cfabc5033bd
BLAKE2b-256 34c474521664aad073819948728d5507905fcc25fe36d78ebe32380bc85619c2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.7.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9211029c6e37b3672cc20c3b84d57f030c3cc848c1095b954907bec9d9789b9f
MD5 3e7d1e3eae17674d1e5cec1cb2e13062
BLAKE2b-256 622fa90d0ef114a6d101b6bd17770a6892cae5275ceba1c1a7b553d9fdadca52

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.7.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 743.0 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.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 57ed1f75bec3f14c0f0c7a8c4b9bd81665d45b3d6d6e8a3e858b10daa3191564
MD5 3d8305b0e01933a99654e5c689f3e94e
BLAKE2b-256 8513ec248261640fb1ccfe51f24c49274bc23fa7626288d82033c28dc549b674

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.7.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8a3f791792ed73a11ee655441801fe21b6ed66057429c8532cfbf4961212b2c9
MD5 0a8b36abf15f9be100680f52ce82c574
BLAKE2b-256 e631c7d35edd1aef71b35ea0f175b0ca007907a2c6d7248b9480c7bf1d697249

See more details on using hashes here.

Provenance

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

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