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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.5.2-cp39-abi3-win_amd64.whl (376.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.5.2-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.2-cp39-abi3-macosx_11_0_arm64.whl (554.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.5.2-cp39-abi3-macosx_10_12_x86_64.whl (566.0 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

xa11y-0.5.2-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.2.tar.gz.

File metadata

  • Download URL: xa11y-0.5.2.tar.gz
  • Upload date:
  • Size: 110.9 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.2.tar.gz
Algorithm Hash digest
SHA256 2a1869c0256a20a2a09746aaca41c6b87ad8f2253f637db15b4d68286f5a73a0
MD5 0e8667e56deab062b69a8f975bf210b6
BLAKE2b-256 8da0601e196f68fb8ef89d7f13dcd861260e0731c563384d5669b2b852f9207d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1a2ec498246ee4d331bf280a9053605dc9380cd79abcc3156db1bcaa9e97af16
MD5 0294a3fb6cb616ebe7337faf1b303450
BLAKE2b-256 aa8a042c1f5955b63656d92b3f420e8693d53c99e0b6a8cdb8ac99219b3066d8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aab627e64d732c847e184839313e8f122adcdf7b25869e8baa3337f31b5acdb7
MD5 1154356d07c60d06afc5dacebecb9d69
BLAKE2b-256 f503076e0fa7ad190f604ce49be15fee762833102f346bd4615766915c56538f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.5.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 376.1 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.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 13f3430618bb1d2b93e9653db152eb97d0756e7549f87db0cf28af4c8736f566
MD5 3473d3c63b35f61ccf0b9835a7436861
BLAKE2b-256 0ad15eb9229a657f74e7529aa7b26ae26eba60a2b50b62d538661459521bb4d8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e56a3e90cea6ed07b4a184206fe5a97febd7ee666295c9d16ce325d826084e86
MD5 ef126e4a286e0505c340184ea0260a64
BLAKE2b-256 745c59aca7b0174738984161bf9c0d25c7bafab8d9428f3a05c434f0853c1f38

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.5.2-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 554.1 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.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6551fba75ab0423df183ec17a1ffaba78268864499495107e396081f13c23ae
MD5 b6777bf234c56076458e1dd56d96aef4
BLAKE2b-256 fea1cfd4db268b734617bf31a80bc9f24801b671f623c4bfa16091408b5d8132

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 24ba00e02ef4e2a86428d0c55f83687d2009044f36726a5c3a94bdd19e06224f
MD5 d4ab46255f2b68ad654678437640bd3d
BLAKE2b-256 bf25b495449ba842e0ae1f90149945908ba61026f057777ce414768b6c51c6a2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1bbc3d3c0a50862f586a721ad0e97821c5c2a5c2ea251abf710592774ac132a2
MD5 46818f95d8198b8c13eaca72663c8d0a
BLAKE2b-256 ce4d3eaede3cebb91e02b1abde34cbb188069f43b057d1e18d14ba60944a24fd

See more details on using hashes here.

Provenance

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