Skip to main content

Cross-platform accessibility client library

Project description

xa11y

Crates.io PyPI CI License: MIT Docs

A Playwright-style API for driving native desktop apps on macOS, Windows, and Linux. Built for end-to-end tests, computer-use agents, and assistive tools.

Use cases: end-to-end desktop testing, computer-use agents, MCP tools, assistive technology.

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.2.tar.gz (267.1 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.2-cp39-abi3-win_amd64.whl (625.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.8.2-cp39-abi3-macosx_10_12_x86_64.whl (813.5 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xa11y-0.8.2.tar.gz
  • Upload date:
  • Size: 267.1 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.2.tar.gz
Algorithm Hash digest
SHA256 2b2425dd5210f62791c84cbda0ede305d05ab3022ba9773d39f58628353d0be7
MD5 3e156dd8a1b7194f39c78f1b1437e1b5
BLAKE2b-256 122bde5985c398f25f7549229fbab0505192af96ce9e7144fac2c598353882e0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.8.2-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 625.1 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.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 20f67c9796a3bfc4e7b0a4ec52d2a71d8b453099a1672271e56a7dd3e9c045d3
MD5 688e6f6bee011e12baae5ce6335f023e
BLAKE2b-256 a5eb26bd97800ad206f71ff36ffc446a43f33c6edbc42987c6dabf32a9e38055

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b5e1d749ebd9925403a6b077fa944a4089fe59545da6b5c48084f87623215a65
MD5 4dc5fc905ab873d065f7273c11b724b7
BLAKE2b-256 1b1d75a463c9b9da5cce51239df0e3a5826cd55bc87267f0546130b701c57c9b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9a846ba20b55afdfbf7334bbf0ed4c8fe5c4a298f5cd3f2139dd300884119b2e
MD5 53f499a8715203c5c9c7b70e7a5177a8
BLAKE2b-256 2aab3b15e53f60afbaf5f583b5dc2653ca5a94044a9d3edc7d0656aa37ef2836

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.8.2-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 792.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.8.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5f1d99ae664b513f6da346bf500d24455ffeb4b2dd67f04fb0bd4ff2d58c511a
MD5 215c9c5600848094a2b2b670bd6c12cf
BLAKE2b-256 ad5224bbc91abda4dd48d72d64ea631f7d55794de22d44d62f40ccfe1f591546

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.8.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3951d4cf0615aa8677e12f62fb487f3a4a3d4819c08d8e0827de33fc04dfde18
MD5 50928fdc731dbd2da63c3baee40e54fb
BLAKE2b-256 ee35b617b761414e1fefe4a45dd486e9f797270619a19a153f332960e23a8811

See more details on using hashes here.

Provenance

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

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