Skip to main content

Cross-platform accessibility client library

Project description

xa11y

Crates.io PyPI CI License: MIT Docs

A Playwright-style library 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.11.0.tar.gz (332.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.11.0-cp39-abi3-win_amd64.whl (677.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.11.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

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

xa11y-0.11.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

xa11y-0.11.0-cp39-abi3-macosx_11_0_arm64.whl (820.3 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.11.0-cp39-abi3-macosx_10_12_x86_64.whl (847.2 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.11.0.tar.gz
Algorithm Hash digest
SHA256 6a1e4f78b3b4467d4aadd0fd7d47e514e2d819a22a013002ce87d4af084fdd98
MD5 ba502f4e43e6f78098dafe0c6e3c9906
BLAKE2b-256 c3b765e66b0a82ba8d9c9b862f9fb3b7fe7db6d5eac79cbd63fe5864e47c37b8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.11.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 677.9 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.11.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0823b179b3afa1c2f3d8ae29574f8baa001e50108f586857d8211e9957f7638a
MD5 987a600de2f88a6f314bcb2da569af09
BLAKE2b-256 58f2365c35fff94e6a163a240397acd018cf5a9769a854055fa77bb84db435bf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.11.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5a4d609645ca4b097a3dfe2e6506324ba97933e9bbf68af4fc6c9c240d2e646
MD5 54cd0194021a0747c86d572af927d511
BLAKE2b-256 81e3cab56773d01e2c283fdb852a798ea7e15fb25790c1b10a86f2b68199dde5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.11.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 232b3af9a7c5d428f2ea75014396846b31965522ac746c9ca8a331805f71e40c
MD5 3d38c6214ad750d6468742f71e2a36a3
BLAKE2b-256 4a97cc51081e8bee384bd5a35949b8cde9453da2e71da4afe69750f1f4416a48

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.11.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 820.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.11.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ce21e5da0310c1aba847730d8e85f0a66e1f0873335a78f09050f90dabd23523
MD5 a9ce35254e9d07710eede5e4a34e6dd9
BLAKE2b-256 12788259dedd967953dc0e523635c27b0aa671c49e57cf6ddeb5c9fd8ba8073d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.11.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dd76d61abe782b775d754a30ef7306ee81f3a3c5197f978f4598274da536909c
MD5 a6183c9d059bbd3301fc786555f9fc07
BLAKE2b-256 4af448d94eda9148e6c3caecf5b5efcf0fdc1cbbb4e05b6c6963693d22d96ca7

See more details on using hashes here.

Provenance

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

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