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.8.0.tar.gz (249.2 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.8.0-cp39-abi3-win_amd64.whl (605.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

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

xa11y-0.8.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.8.0-cp39-abi3-macosx_11_0_arm64.whl (789.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl (807.3 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.8.0.tar.gz
Algorithm Hash digest
SHA256 97aaa0b5646c6b1c3e3f98f519accb83af2d028066d1d59301da1f7849b83b43
MD5 ca24442496ea358000ab23df5fe0c868
BLAKE2b-256 beb1dc835ebafbca7fbd936480c718552fe25fcbbfc63d13622008a971af0888

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.8.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 605.4 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.8.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f69f8570bd6bae6a1008cb650dee3069c318b939a3f4fb324eebfe77d1627519
MD5 ccd507f92fe8194a39c1333b69e89b66
BLAKE2b-256 c4d8b4e2482a2280dda11752f2548ef3e2be82653389f964186db89db6519aae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 359b66f4af5dcca021c9b23e288ad6481b86fb83010f4cef4cfc7fe7086e9124
MD5 6b912d285d9ec540d06f9384bb86d941
BLAKE2b-256 8d3888f411b8534be505f42f3ca61a5085ab7e09ee3081770b9d17c2f2e2c513

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 886deee5c442d4f90aad5853b349d5ba60342a0e1b4f3c0d792449d3191fffff
MD5 1ad85722c2da8a770602a7c1ce577da0
BLAKE2b-256 0f8946c0bfc78b0a9e7fa781379cd134f1ba6894db2adfea040447fd66c09d07

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.8.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 789.1 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.8.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34ca8827c25c7753306eaf749891718ccc187453c55b81d6949e7b6ca011a879
MD5 a9da4dfa335ac2ecd7790f49debe4404
BLAKE2b-256 785b110f42d98b1ce4f947e71be9473d68a982ed6415d2187361fdeb7155643b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0c05a1abf2a62ec55df7073c5aa776da117aac9263da5983eb4c6302c75acd28
MD5 ed0aa7c8c9b87aeee2e9a66a18beaf9d
BLAKE2b-256 4e1bf16f686521dd309bd7b7245cc139af965c5a057a0eeecfc8703e221d07fc

See more details on using hashes here.

Provenance

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