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.9.0.tar.gz (302.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.9.0-cp39-abi3-win_amd64.whl (668.0 kB view details)

Uploaded CPython 3.9+Windows x86-64

xa11y-0.9.0-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.9.0-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.9.0-cp39-abi3-macosx_11_0_arm64.whl (828.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

xa11y-0.9.0-cp39-abi3-macosx_10_12_x86_64.whl (849.3 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: xa11y-0.9.0.tar.gz
  • Upload date:
  • Size: 302.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.9.0.tar.gz
Algorithm Hash digest
SHA256 e0a40918539fd1d67f9df0e410a729703846dc779745a8a987a3cae7bd28c520
MD5 6fd253ae592d12712fd77e95d86b7d85
BLAKE2b-256 5c2bd8e8b11008c8eb0c6f0dad30c8f21574b5ba30de8bf3cee6d71bdf415e09

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.9.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 668.0 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.9.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ff8457ca6b6409b927d0be04050873f13a263c24d55be4ce818a9c4f6865a5d1
MD5 b8171ffd4aa9aecae3e616c1e0acdd1b
BLAKE2b-256 5de599a7729abcf55febda4c1423ae4810a93788a808cc28cbb25b2d2d27cc8d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.9.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f18db4023194e5af1874500ab2d0bf459e25b27f8f59bd9d1a93f8bcea8dd938
MD5 3ac10a0e1cdd36cbf90314fda47ec48d
BLAKE2b-256 e2bee832e2ebc5e84e50db23ddba982960986b6031ad560d61b745f26277d8c5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.9.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1a7c874a99604b30552cb7adde5c0e144eeb9f29dbe19754106f653801644002
MD5 50bfecb298899e70a933c5ba61370fef
BLAKE2b-256 0e6b777c2cef3d06ad9b97e55dcf300729d769d1ddd8c439f92c93115c43f62c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: xa11y-0.9.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 828.5 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.9.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 81ca6d70d491ea6e5142e6589118df6f8b0d7f501735280bcb1cec9337bd4817
MD5 48572de9a52966e0d931ff4d92a66261
BLAKE2b-256 8b798367db4db3eb2a43097cbb872d63769864f73ba6956110f15fd38bb6daf9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for xa11y-0.9.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2ea27f83ba04a101aaa74be99158426027536df7d2563de1c7214f65ee952659
MD5 a7bd7c5202be5910111db7efe9f14d47
BLAKE2b-256 ab79930cc8338f4659a3e217eb19e1b0916342cf87416d126c28ebe1577fe727

See more details on using hashes here.

Provenance

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