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.6.1.tar.gz (122.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.6.1-cp39-abi3-win_amd64.whl (439.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.6.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

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

xa11y-0.6.1-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.6.1-cp39-abi3-macosx_11_0_arm64.whl (611.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.6.1-cp39-abi3-macosx_10_12_x86_64.whl (625.0 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xa11y-0.6.1.tar.gz
  • Upload date:
  • Size: 122.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.6.1.tar.gz
Algorithm Hash digest
SHA256 97b79336f6be94e25d3268ce70ee368533046572e5fcabaf4f7e283aae34a411
MD5 62bc87c81d5412cf2c6e5498b54bb8aa
BLAKE2b-256 4bdcc733cf681eb8fc27d3f16719dbe175d339a5850abd7da857ac2965c2485d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.6.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 439.8 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.6.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5f600531d1642df7bf1d4e64519df537e23b0fc154b8499b4aa054726c687bdc
MD5 9e8b87c1a3776721e8d0db16a1b7c8a4
BLAKE2b-256 33081b2270406722db6a07bb9544ee8182a535f1e1fba5866d606af833da489f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7a7ec80ba0753ed8f14e62850351b9efc2fcc41283ea87f8bfc269d827e1af61
MD5 03fc103bee022b068ad1aaa35962042e
BLAKE2b-256 8b4fae6e17fe44e019aebbd046139634b234e0a2c982c4366029e25e832f685d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8dc042211be22d8cb97d57522136fcab0dbba84789c8da69724a122a5acbc680
MD5 c6ccf186b97f7a1567b6ea6a1e98493e
BLAKE2b-256 2b4c496197d10ea553177f89885bbdec7f524f0e35782426f0017213c4460025

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.6.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 611.3 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.6.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1189d5c2f0cdfa6a84c7d73c97b55553abce0130905284389e31c873f44b1ee3
MD5 c339a4eb1a10df3303b9f971f301007c
BLAKE2b-256 f00d6c545b9a6915678cc83b297d4497fbb47237326bfc7e2527008a3646bf90

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d46fbe23e86acb2e99420f03775459b9d7f1b7756a6d627206534b3b72e5e96e
MD5 a2ad1d36eca05aac5de22d02b8998ede
BLAKE2b-256 eafe2cd5a41298f1cb2b2dfdd9aa5f39c4ce34042e585c72d06f8255f4ff1b56

See more details on using hashes here.

Provenance

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

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