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("Safari")

# Find elements with CSS-like selectors
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("textfield[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 accessibility permissions to your terminal in System Settings > Privacy & Security > Accessibility.

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.4.0.tar.gz (98.7 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.4.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.4.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

xa11y-0.4.0-cp39-abi3-win_amd64.whl (325.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.4.0-cp39-abi3-macosx_11_0_arm64.whl (449.7 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl (458.7 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

xa11y-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c516f943552008a869a47fc01521bd689ef17cd172e4b32507adf3f664ec8d00
MD5 c2e79b2a57add216c2e2de38cb3476cb
BLAKE2b-256 f85d12dba0a674fd667445da687c564bc71bf5b7bb44b7b66f18ec36cc9d235d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.4.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8f76f644379a1cd2b7ad0935548f289cd3f25324f30a4023c3b864b6e0a35863
MD5 36a34d8ef12dadffdbfb0d3680c58907
BLAKE2b-256 bf6f219e453f09e8b38a5cb701256ba314be07bb1a1e3bc37f81ab5328e73383

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.4.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 64ba2a2184ce020bb7885070085a8a29e456de9eb95b3caa3ed06c00fccaf6c1
MD5 8bd70a34e42142feaf1000e48e88c258
BLAKE2b-256 5735a0e1dfa5e59bacd25ec24979dd18408e405dd88b2439f9f48fbdb6e4a4ca

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.4.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 325.0 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.4.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7d7f209074109b11e4bd3f621222050ae07223186545782dc01a7343fc78829c
MD5 a1faf6b8f4f87ac595b10657921f2644
BLAKE2b-256 eff6c66d3a0b8297909d7cd1c9d983924f3bd607937b543c9ad0c0110c92631e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2bfe19616be8eb574c173008ca52ede88bd09daba3258fa43af3531f5ba42e0d
MD5 f4e4bd403b0c092b483124e33f702414
BLAKE2b-256 952a2b7d16e2ce7e12b754d4d5a8b1888cc18663b3b3ba525461f11866205b19

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.4.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 449.7 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.4.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ff1317c936ce9296bb7fe0117583e98d05b80ee29bde1f5109f2bf5333fe36b
MD5 cd7c539b1baa5b846415b98f0e9c313f
BLAKE2b-256 13c6b9444dad8bee3890cdfc361ed7c413167a2561cc510971aa636d1ab3043a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8f9a4378e18820f41474655a5b876f611fda10d7dcb942cb32e6eac30ed4b920
MD5 c7b0d355b56a25fc54134999e832ae45
BLAKE2b-256 ce00b08b4e5f7bc592000b90615b6f8b617bd18c0042f5a1d1704600c5bc2a45

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 21e99949651aed7b45b35e321520d1249a2a7c8fda584e712d43ea6e32025901
MD5 bb4b6eccdbb4ce3d03a018c191d10ef3
BLAKE2b-256 e8e2a68db5953caa318baaddfcb5c5cf1ee80a07ab155d96da5df844f12e3c22

See more details on using hashes here.

Provenance

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