Asynchronous Python client for the accessibility checker API
Project description
a11y-checker
a11y-checker is an asynchronous Python client for the Accessibility Checker API - a tool for automated accessibility audits based on WCAG 2.1 / 2.2.
It lets you easily scan, re-scan, and analyze websites directly from your Python applications.
Features
- Fully asynchronous (non-blocking)
- Multi-language and device scanning
- Fetch, re-scan, or delete audits
Installation
pip install a11y-checker
Usage Example
import asyncio
from a11y_checker import A11yCheckerClient, Device, Language
async def main():
async with A11yCheckerClient() as guest:
# Run a new audit
audit_request = await guest.scan("https://example.com", lang=Language.EN, device=Device.DESKTOP)
print(audit_request)
# Get audit
audit = await guest.audit(uuid=audit_request['uuid'])
print(audit)
# Delete an audit
await guest.delete_audit(audit['uuid'])
asyncio.run(main())
🔑 Get Your API Key
You can test as a guest, request an API key, or test the service directly on the website:
👉 https://wcag.dock.codes/contact-us/
Enums
| Enum | Description | Example |
|---|---|---|
| Language | Language for audits | Language.EN, Language.PL, Language.DE |
| Device | Device type for scanning | Device.DESKTOP, Device.MOBILE, Device.ALL |
| AuditStatus | Filter audits by status | AuditStatus.PASSED, AuditStatus.FAILED, AuditStatus.TO_TESTS |
| Sort | Sorting order for results | Sort.CREATED_AT_DESC, Sort.LAST_AUDIT_ASC |
Available Methods
| Method | Description |
|---|---|
scan(url: str, lang: Language, device: Device, sync: bool, extra_data: bool, unique_key: Optional[str], key: Optional[str]) |
Run a new accessibility scan for a given URL. |
audit(uuid: str, lang: Language, extra_data: bool key: Optional[str]) |
Get detailed results of a specific audit. |
audits(search: str, page: int, per_page: int, sort: Sort, unique_key: Optional[str], key: Optional[str]) |
Fetch paginated audits with optional filtering and sorting. |
rescan(uuid: str, lang: Language, sync: bool, extra_data: bool = False) |
Trigger a re-scan of an existing audit. |
history(uuid: str, page: int, per_page: int, sort: Sort, key: Optional[str]) |
Fetch paginated audit history with optional filtering and sorting. |
delete_audit(uuid: str, key: Optional[str]) |
Delete an existing audit. |
delete_history(uuid: str, key: Optional[str]) |
Delete audit history. |
user(key: Optional[str]) |
Get current user data. |
update_audit_manual(uuid: str, criterion_id: int, status: AuditStatus, device: Device, key: Optional[str]) |
Updating the status of a single criterion from a manual audit. |
Advanced Example: Parallel Audits
import asyncio
from a11y_checker import A11yCheckerClient
async def main():
async with A11yCheckerClient(api_key="your-api-key") as client:
results = await asyncio.gather(
client.audit(uuid="uuid1"),
client.audit(uuid="uuid2"),
client.audit(uuid="uuid3"),
)
print(results)
asyncio.run(main())
🤝 Contributing Contributions are welcome! If you find a bug or want to improve the library, please open an issue or pull request on 👉 GitHub
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file a11y_checker-1.0.3.tar.gz.
File metadata
- Download URL: a11y_checker-1.0.3.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e4274eb253af9f3ce5234a0d7149bcf9827e586ee31f4180715b3a9f5dd7438
|
|
| MD5 |
fd6959a387bf1b93a87570bb5dd95890
|
|
| BLAKE2b-256 |
b9918ec26de6574934325bd0c81344706fa32e2360ef6e18411b9601766948d0
|
File details
Details for the file a11y_checker-1.0.3-py3-none-any.whl.
File metadata
- Download URL: a11y_checker-1.0.3-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7629b9a55000a292ac6ac8fd076510a591672de2e356140d8e02395a9c79674
|
|
| MD5 |
b5223308454f3b175a5ba8e3869f6c85
|
|
| BLAKE2b-256 |
7489db06724df6858b436e14aab5e5fff303e18fe726275c9dde5e313954757a
|