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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.6.0-cp39-abi3-win_amd64.whl (439.5 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.6.0-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.0-cp39-abi3-macosx_11_0_arm64.whl (611.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl (625.2 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

xa11y-0.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2eea210485b25889457e885234db6ff8ef9f4f51331eca94a7f28dae4628b304
MD5 f8e31939a04155ef227f47cbb13400d3
BLAKE2b-256 155e690b157d36b176276e1168444be521b493a7d8bee08a7e8bdc2ce6b4fae0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 770454fbfb3688b8575306b9298a3610aa36543be162897498615160cb7e3061
MD5 76f51e36c71c8434b6219a426f576ddd
BLAKE2b-256 047f53f6dac3ca38db838024e98f7205b6f90304050dfd9634313ce5f0dc6774

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cde7ded0e2eb7f4fba8811b0b364b0f92d085358e529d83548002eae3d65101f
MD5 1c1a2c7d023d78ea498c58c3e1e55dbb
BLAKE2b-256 aa4e730fc9fc5a220f8d33ade7e95a28f5f31bec766a67dc7fee1403d064fcee

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.6.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 439.5 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.6.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dac960d4047b26f622b10611be84450c2b64ad0ec436aad44ca4f546f31a1120
MD5 d172c0c4a6fbf9134865148d5504f9e0
BLAKE2b-256 7562f00085184c70cdd745335f388c582ff75be66295d729ae92e6224cc42bde

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b2951c969acd0727e593c8e3c1d241078366a4a61ec4121ab33bd8cca58c540e
MD5 244f26adf543a9fb250d17c1b6d0622f
BLAKE2b-256 9962ff2107267d0318d1f0277443390024bd687947175e63107f5ca20d3f57b1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.6.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 611.6 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.6.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d79272506a26efac23a95cb2490435509c4e40208eb3eaa3422ee3d65008f6a4
MD5 b1a18b15d28d6d35dbe55680b2553140
BLAKE2b-256 f6dab3dad378f259c6f9a350ccfe8401a63b35eef4c32d9ff9b960a8f8c11195

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.6.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1cdc0045f55684a7077ee0bfa94156d64e50f5f6505b0f1380b914546b056ce5
MD5 db3de9b5cecbd7452d2b3b8e873f14c0
BLAKE2b-256 79569f3059ee616d36cddb953ab9a13de1686b150e1564be1ec7d1a3c2fd092c

See more details on using hashes here.

Provenance

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

File details

Details for the file xa11y-0.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for xa11y-0.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a430941ca15b7830ab020edf7d514e935e96f6f7da62e115e353d37b30ce65c4
MD5 44e57cd1ecde33220def347eac87df5d
BLAKE2b-256 454c8c38a7947a60be549b439e8343bef957d0961779b562b803f749a4f69232

See more details on using hashes here.

Provenance

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