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.10.0.tar.gz (323.4 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.10.0-cp39-abi3-win_amd64.whl (677.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.10.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.10.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.10.0-cp39-abi3-macosx_11_0_arm64.whl (822.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.10.0-cp39-abi3-macosx_10_12_x86_64.whl (843.5 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for xa11y-0.10.0.tar.gz
Algorithm Hash digest
SHA256 64fadf30142ca8832c9d0e229e8b2ecd09d026f7e05dff2e305dbb6b71a7d307
MD5 fa82ad5a6b852ea22c1e95019916435a
BLAKE2b-256 14147f53425546f2188f7fdef24c3717253e0471cd171b8eed5542d0ddd6897a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.10.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 677.4 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.10.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0f006e7cba898a1653d780b61323335bc83d5eb33c148b18ed41c1b154b58680
MD5 0c45431678082360ff5d8d167169a365
BLAKE2b-256 ae6920c8b121bc80258119e543f12178432792dea5c2d16d66c7b5c1e963928d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.10.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4c20104242f189234d586818d71d5d0e1e36e637f67f5f18f15c6f95d8c07d14
MD5 b0a6e177330fd4a832930922a4cda1a9
BLAKE2b-256 1014c6d5fb7d4f40b09495123b1bebf7854bdd7abd7bd84a79d114f3df9ed953

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.10.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5bf351715235b204fe0351bb30e927022a6e08839e048716d1ec89ca0e2640e4
MD5 94f1a88f075b4465dd3bb7b1f0993574
BLAKE2b-256 7fd884d40580ea620b551590badf943e480196a526c025e32cf91a27ef783dd5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.10.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e3b8986477067eb935de00cd45b6855ace2fd9e27710c84a1500e4ba3f728c8
MD5 64b948821b5bb3349dff2d702ca0e016
BLAKE2b-256 602aef48446171d7c1a5cdf86604902de5855f1f00e7f150f5b3d7ca9cfbaa6a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.10.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eee3840ae5e5296ad200154c5750fb1cccbf274ea006639b51a2c3f8ce8c468d
MD5 452762e3d96ffc506a2721327a1dc105
BLAKE2b-256 c0a76aaa3e62b71c5b030d1fceb65895a61b8d88ddacc531078304588ea5f4be

See more details on using hashes here.

Provenance

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